diff --git a/client/src/pages/cat-image.tsx b/client/src/pages/cat-image.tsx
deleted file mode 100644
index 64d2caa..0000000
--- a/client/src/pages/cat-image.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from "react";
-import Header from "../components/header";
-import {SAPIBase} from "../tools/api";
-
-const CatImagePage = () => {
- return (
-
-
-
Static *Cute* Image
-

-
Wow so cute from static
-
- );
-};
-
-export default CatImagePage;
\ No newline at end of file
diff --git a/client/src/pages/css/feed.css b/client/src/pages/css/feed.css
index 53580df..6529dc3 100644
--- a/client/src/pages/css/feed.css
+++ b/client/src/pages/css/feed.css
@@ -41,4 +41,18 @@
.delete-item:hover {
font-weight: bold;
cursor: pointer;
+}
+
+.edit-item {
+ position: absolute;
+ right: 50px;
+ top: 12px;
+ color: blue;
+ font-size: 18px;
+}
+
+.edit-item:hover {
+ font-weight: bold;
+ cursor: pointer;
+ font-size: 24px;
}
\ No newline at end of file
diff --git a/client/src/pages/css/kawaii-stagram.css b/client/src/pages/css/kawaii-stagram.css
new file mode 100644
index 0000000..76e7ab6
--- /dev/null
+++ b/client/src/pages/css/kawaii-stagram.css
@@ -0,0 +1,64 @@
+.feed-list {
+ padding: 25px 10px;
+ width: calc(100% - 20px);
+ max-width: 800px;
+ margin: auto;
+}
+
+.feed-item {
+ border: solid 1px rgba(0,0,0,0.2);
+ border-radius: 15px;
+ width: 100%;
+ margin: 10px 0;
+ position: relative;
+ background-color: #FFD700; /* Golden yellow */
+ box-shadow: 0 0 10px rgba(0,0,0,0.2);
+ font-family: "Varela Round", sans-serif;
+ font-size: larger;
+ font-weight: 400;
+ font-style: normal;
+}
+
+.feed-item-add {
+ border: dotted 1px black;
+ border-radius: 15px;
+ padding: 20px 10px 0 10px;
+}
+
+.post-add-button {
+ margin-top: 20px;
+ padding: 10px;
+ border-top: solid 1px rgba(0,0,0,0.1);
+}
+
+.post-add-button:hover {
+ cursor: pointer;
+ font-weight: 700;
+}
+
+.delete-item {
+ position: absolute;
+ right: 15px;
+ top: 12px;
+ color: red;
+ font-size: 18px;
+}
+
+.delete-item:hover {
+ font-weight: bold;
+ cursor: pointer;
+}
+
+.edit-item {
+ position: absolute;
+ right: 50px;
+ top: 12px;
+ color: blue;
+ font-size: 18px;
+}
+
+.edit-item:hover {
+ font-weight: bold;
+ cursor: pointer;
+ font-size: 24px;
+}
\ No newline at end of file
diff --git a/client/src/pages/feed.tsx b/client/src/pages/feed.tsx
index b64c53b..98e35fa 100644
--- a/client/src/pages/feed.tsx
+++ b/client/src/pages/feed.tsx
@@ -44,6 +44,21 @@ const FeedPage = (props: {}) => {
asyncFun().catch(e => window.alert(`AN ERROR OCCURED! ${e}`));
}
+ const editPost = (id: string, newTitle: string, newContent: string) => {
+ const asyncFun = async () => {
+ await axios.post( SAPIBase + '/feed/editFeed', { id: id, title: newTitle, content: newContent } );
+ const updatedPosts = LAPIResponse.map( (val) => {
+ if (val.id === parseInt(id)) {
+ val.title = newTitle;
+ val.content = newContent;
+ }
+ return val;
+ });
+ setLAPIResponse(updatedPosts);
+ }
+ asyncFun().catch(e => window.alert(`AN ERROR OCCURED! ${e}`));
+ }
+
return (
@@ -58,6 +73,11 @@ const FeedPage = (props: {}) => {
{ LAPIResponse.map( (val, i) =>
deletePost(`${val.id}`)}>ⓧ
+
{
+ const newTitle = window.prompt("Enter the new title", val.title);
+ const newContent = window.prompt("Enter the new content", val.content);
+ if (newTitle && newContent) editPost(`${val.id}`, newTitle, newContent);
+ }}>🖍️
{ val.title }
{ val.content }
diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx
index 3611def..66df8c1 100644
--- a/client/src/pages/home.tsx
+++ b/client/src/pages/home.tsx
@@ -39,13 +39,9 @@ const HomePage = (props: {}) => {
Example #2
Middleware & Authorization
-
navigate("/cat-image") }>
-
Example #3
-
Serve *Cute* Image Files
-
-
navigate("/ssr") }>
-
Example #4
-
Server Side Rendering
+
navigate("/kawaii-stagram") }>
+
cyber's example
+
Kawaii-stagram
diff --git a/client/src/pages/kawaii-stagram.tsx b/client/src/pages/kawaii-stagram.tsx
new file mode 100644
index 0000000..d83aa78
--- /dev/null
+++ b/client/src/pages/kawaii-stagram.tsx
@@ -0,0 +1,102 @@
+import React from "react";
+import axios from "axios";
+import { SAPIBase } from "../tools/api";
+import Header from "../components/header";
+import "./css/kawaii-stagram.css";
+
+interface IAPIResponse { id: number, title: string, description: string, image: string }
+
+const KawaiiStagram = () => {
+ const [ LAPIResponse, setLAPIResponse ] = React.useState