From 1f747cf167400c25f1d57258ade88a88d7019f98 Mon Sep 17 00:00:00 2001
From: FeliciaDixon-WA
Date: Thu, 4 Mar 2021 10:52:40 -0800
Subject: [PATCH 1/3] date added
---
client/.env | 1 +
client/package-lock.json | 38 +++-
client/package.json | 1 +
client/src/App.js | 4 +
client/src/currentTime.js | 24 ++
package-lock.json | 467 --------------------------------------
6 files changed, 66 insertions(+), 469 deletions(-)
create mode 100644 client/.env
create mode 100644 client/src/currentTime.js
diff --git a/client/.env b/client/.env
new file mode 100644
index 0000000..7d910f1
--- /dev/null
+++ b/client/.env
@@ -0,0 +1 @@
+SKIP_PREFLIGHT_CHECK=true
\ No newline at end of file
diff --git a/client/package-lock.json b/client/package-lock.json
index 33bafe6..4f34078 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -3293,6 +3293,15 @@
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
"optional": true
},
+ "bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "optional": true,
+ "requires": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
"bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -6120,6 +6129,12 @@
}
}
},
+ "file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "optional": true
+ },
"filesize": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
@@ -9222,6 +9237,11 @@
"minimist": "^1.2.5"
}
},
+ "moment": {
+ "version": "2.29.1",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
+ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
+ },
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
@@ -9264,6 +9284,12 @@
"resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
"integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE="
},
+ "nan": {
+ "version": "2.14.2",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz",
+ "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==",
+ "optional": true
+ },
"nanoid": {
"version": "3.1.20",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz",
@@ -14389,7 +14415,11 @@
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
- "optional": true
+ "optional": true,
+ "requires": {
+ "bindings": "^1.5.0",
+ "nan": "^2.12.1"
+ }
},
"glob-parent": {
"version": "3.1.0",
@@ -15004,7 +15034,11 @@
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
- "optional": true
+ "optional": true,
+ "requires": {
+ "bindings": "^1.5.0",
+ "nan": "^2.12.1"
+ }
},
"glob-parent": {
"version": "3.1.0",
diff --git a/client/package.json b/client/package.json
index bf0390a..a0514c6 100644
--- a/client/package.json
+++ b/client/package.json
@@ -7,6 +7,7 @@
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.21.1",
+ "moment": "^2.29.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.3",
diff --git a/client/src/App.js b/client/src/App.js
index 5288216..ab23574 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useState } from "react";
import axios from "axios";
+import CurrentTime from "./currentTime"
axios.defaults.baseURL = 'http://localhost:5000';
axios.defaults.headers.post['Content-Type'] = 'applicatin/json';
@@ -33,6 +34,9 @@ function App() {
This is the bootcamp final.
+
+
+
{
+
{
diff --git a/client/src/currentTime.js b/client/src/currentTime.js
index 3fec653..c4ce94c 100644
--- a/client/src/currentTime.js
+++ b/client/src/currentTime.js
@@ -1,8 +1,6 @@
import React, { useState, useEffect } from 'react';
-// import moment from 'moment';
export const CurrentTime = () => {
- // var time = moment().format('MMMM Do YYYY, h:mm:ss a');
var [date, setDate] = useState(new Date());
diff --git a/client/src/isPalindrome.js b/client/src/isPalindrome.js
index 91ffb24..09fb7c8 100644
--- a/client/src/isPalindrome.js
+++ b/client/src/isPalindrome.js
@@ -1,16 +1,12 @@
-function isPalindrome(str) {
+export function isPalindrome(str = " ") {
var word = str.length;
- if (word === 1) {
- return true;
+ if (word === 1){
+ console.log(true) && alert("1 word is a palindrome");
}
-
- if (str[0] === str[word-1]) {
- return isPalindrome(str.slice(1, word-1) );
- }
- return false;
+ else if (str[0] === str[word - 1]) {
+ return isPalindrome(str.slice(1, word - 1)) && alert("is a palindrome");
+ } else{
+ console.log(false) && alert("not a palindrome");
+ }
}
-console.log(isPalindrome('ab'));
-console.log(isPalindrome('madam'));
-console.log(isPalindrome('kayak'));
-console.log(isPalindrome('moms'));
\ No newline at end of file