-
+ return (
+ <>
+
+
-
-
- {emotes.map((emote, i) => (
-
handleEmojiClick(emote.emoji)}>
- {emote.emoji} {emote.count}
-
- ))}
+
+ {(emotes.length ? emotes : noEmotes).map((emote, i) => (
+ handleEmojiClick(emote.emoji)}
+ >
+ {emote.emoji}{emote.count}
+
+ ))}
+
-
,
-
- {emojiMenu.map((emoji, i) => (
- handleEmojiClick(emoji)}>{emoji}
- ))}
- ,
- ]
+
+
+ {emojiMenu.map((emoji, i) => (
+
+ ))}
+
+
+ >
+ )
}
export default EmojiReaction
diff --git a/web/src/components/Part2Cell/Part2Cell.js b/web/src/components/Part2Cell/Part2Cell.js
new file mode 100644
index 0000000..3314d4a
--- /dev/null
+++ b/web/src/components/Part2Cell/Part2Cell.js
@@ -0,0 +1,110 @@
+import Editor from "rich-markdown-editor";
+
+// import Part from 'src/components/Part'
+import ImageUploader from 'src/components/ImageUploader'
+import Breadcrumb from 'src/components/Breadcrumb'
+import EmojiReaction from 'src/components/EmojiReaction'
+import Button from 'src/components/Button'
+
+export const QUERY = gql`
+ query FIND_PART_BY_USERNAME_TITLE($userName: String!, $partTitle: String!) {
+ userPart: userName(userName: $userName) {
+ name
+ userName
+ bio
+ image
+ id
+ Part(partTitle: $partTitle) {
+ id
+ title
+ description
+ code
+ mainImage
+ createdAt
+ updatedAt
+ userId
+ }
+ }
+ }
+`
+
+export const Loading = () =>
Loading...
+
+export const Empty = () =>
Empty
+
+export const Failure = ({ error }) =>
Error: {error.message}
+
+export const Success = ({ userPart, variables }) => {
+ return (
+ <>
+
+
+ {/* Side column */}
+
+
+ {/* main project center column */}
+
+
+ { userPart?.Part?.mainImage && {}}
+ aspectRatio={16/9}
+ imageUrl={userPart?.Part?.mainImage}
+ />}
+
+ setInput({
+ // ...input,
+ // bio: bioFn(),
+ // })}
+ />
+
+
+
+
+ >
+ )
+}
diff --git a/web/src/components/Part2Cell/Part2Cell.mock.js b/web/src/components/Part2Cell/Part2Cell.mock.js
new file mode 100644
index 0000000..3dde5f5
--- /dev/null
+++ b/web/src/components/Part2Cell/Part2Cell.mock.js
@@ -0,0 +1,6 @@
+// Define your own mock data here:
+export const standard = (/* vars, { ctx, req } */) => ({
+ part2: {
+ id: 42,
+ },
+})
diff --git a/web/src/components/Part2Cell/Part2Cell.stories.js b/web/src/components/Part2Cell/Part2Cell.stories.js
new file mode 100644
index 0000000..8ddfafb
--- /dev/null
+++ b/web/src/components/Part2Cell/Part2Cell.stories.js
@@ -0,0 +1,20 @@
+import { Loading, Empty, Failure, Success } from './Part2Cell'
+import { standard } from './Part2Cell.mock'
+
+export const loading = () => {
+ return Loading ?
: null
+}
+
+export const empty = () => {
+ return Empty ?
: null
+}
+
+export const failure = () => {
+ return Failure ?
: null
+}
+
+export const success = () => {
+ return Success ?
: null
+}
+
+export default { title: 'Cells/Part2Cell' }
diff --git a/web/src/components/Part2Cell/Part2Cell.test.js b/web/src/components/Part2Cell/Part2Cell.test.js
new file mode 100644
index 0000000..231c8c6
--- /dev/null
+++ b/web/src/components/Part2Cell/Part2Cell.test.js
@@ -0,0 +1,26 @@
+import { render, screen } from '@redwoodjs/testing'
+import { Loading, Empty, Failure, Success } from './Part2Cell'
+import { standard } from './Part2Cell.mock'
+
+describe('Part2Cell', () => {
+ test('Loading renders successfully', () => {
+ render(
)
+ // Use screen.debug() to see output
+ expect(screen.getByText('Loading...')).toBeInTheDocument()
+ })
+
+ test('Empty renders successfully', async () => {
+ render(
)
+ expect(screen.getByText('Empty')).toBeInTheDocument()
+ })
+
+ test('Failure renders successfully', async () => {
+ render(
)
+ expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
+ })
+
+ test('Success renders successfully', async () => {
+ render(
)
+ expect(screen.getByText(/42/i)).toBeInTheDocument()
+ })
+})
diff --git a/web/src/components/UserProfile/UserProfile.js b/web/src/components/UserProfile/UserProfile.js
index 925599e..c28ca96 100644
--- a/web/src/components/UserProfile/UserProfile.js
+++ b/web/src/components/UserProfile/UserProfile.js
@@ -45,9 +45,9 @@ const UserProfile = ({user, isEditable, loading, onSave, error}) => {
...textFields,
})} isEditable={isEditable}/>
{isEditable ?
-
: // TODO replace pencil with a save icon
+
: // TODO replace pencil with a save icon
canEdit ?
-
:
+
:
null
}
diff --git a/web/src/pages/Part2Page/Part2Page.js b/web/src/pages/Part2Page/Part2Page.js
new file mode 100644
index 0000000..6b4e752
--- /dev/null
+++ b/web/src/pages/Part2Page/Part2Page.js
@@ -0,0 +1,12 @@
+import MainLayout from 'src/layouts/MainLayout'
+import Part2Cell from 'src/components/Part2Cell'
+
+const Part2Page = ({userName, partTitle}) => {
+ return (
+