Skip to content

Commit 5a00891

Browse files
authored
Merge pull request #43 from firstcontributions/fix-story-editor
2 parents 5717f47 + 0fa417b commit 5a00891

15 files changed

+92
-71
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@editorjs/code": "^2.7.0",
20-
"@editorjs/editorjs": "^2.24.3",
20+
"@editorjs/editorjs": "^2.26.4",
2121
"@editorjs/header": "^2.6.2",
2222
"@editorjs/image": "^2.6.2",
2323
"@editorjs/list": "^1.7.0",

src/components/Button.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const Button = ({
1717
if (color === 'primary') {
1818
return 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800'
1919
}
20+
if (variant === 'outlined') {
21+
return 'text-blue-700 border border-blue-700 hover:bg-blue-700 hover:text-white focus:ring-blue-300 dark:text-blue-600 dark:border-blue-600 dark:hover:bg-blue-600 dark:hover:text-white dark:focus:ring-blue-800'
22+
}
2023
if (color === 'transparent') {
2124
return 'focus:ring-transparent'
2225
}

src/components/ErrorFallback.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import Button from './Button'
2+
13
type ErrorFallbackProps = {
24
error: Error
35
resetErrorBoundary: () => void
@@ -11,7 +13,7 @@ export default function ErrorFallback({
1113
<div role="alert">
1214
<p>Something went wrong:</p>
1315
<pre>{error.message}</pre>
14-
<button onClick={resetErrorBoundary}>Try again</button>
16+
<Button onClick={resetErrorBoundary}>Try again</Button>
1517
</div>
1618
)
1719
}

src/components/ExpandingTextarea.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default function ExpandingTextarea({
2323

2424
React.useLayoutEffect(() => {
2525
if (textareaRef.current) {
26-
textareaRef.current.style.height = 'inherit'
2726
// Set height
2827
textareaRef.current.style.height = `${Math.max(
2928
textareaRef.current.scrollHeight,

src/components/UserDetails/Badges/BadgeList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { graphql, usePaginationFragment } from 'react-relay'
2+
import Button from 'src/components/Button'
23
import { BadgeList_user$key } from '../../../queries/__generated__/BadgeList_user.graphql'
34
import Badge from './Badge'
45

@@ -35,14 +36,13 @@ const BadgeList = ({ user }: { user: BadgeList_user$key }) => {
3536
(badge) => badge && <Badge key={badge.node.id} badge={badge.node} />
3637
)}
3738
{hasNext ? (
38-
<button
39-
className="text-gray-600 dark:text-gray-300"
39+
<Button
4040
onClick={() => {
4141
loadNext(2)
4242
}}
4343
>
4444
Load more
45-
</button>
45+
</Button>
4646
) : null}
4747
</div>
4848
)

src/components/UserDetails/Bio.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ const Bio = ({ user }: BioProps) => {
5757
disabled={isMutationInFlight}
5858
defaultValue={data.bio}
5959
/>
60-
<button onClick={() => setEditMode(false)}>
60+
<button type="button" onClick={() => setEditMode(false)}>
6161
<GoCheck />
6262
</button>
6363
</div>
6464
) : (
6565
<div className="flex justify-between">
6666
<span>{data.bio}</span>
67-
<button className="ml-4" onClick={() => setEditMode(true)}>
67+
<button
68+
type="button"
69+
className="ml-4"
70+
onClick={() => setEditMode(true)}
71+
>
6872
<GoPencil />
6973
</button>
7074
</div>

src/components/comment/Comments.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const Comments = ({ story }: CommentsProps) => {
4242
)}
4343
{hasNext ? (
4444
<button
45+
type="button"
4546
className="text-gray-600 dark:text-gray-300"
4647
onClick={() => {
4748
loadNext(2)

src/components/feed/StoryPreviewFooter.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ export default function StoryPreviewFooter({ story }: StoryPreviewFooterProps) {
5555
{data.reactions.hasViewerAssociation ? (
5656
<div className="flex items-center">
5757
<span>{data.reactions.totalCount}</span>
58-
<button onClick={() => handleReaction()}>
58+
<button onClick={() => handleReaction()} type="button">
5959
<RiHeart3Fill />
6060
</button>
6161
</div>
6262
) : (
6363
<div>
6464
<span>{data.reactions.totalCount}</span>
6565
<button
66+
type="button"
6667
onClick={() => handleReaction()}
6768
disabled={isMutationInFlight}
6869
>

src/components/issue/IssuesFromLastRepo.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ const IssuesFromLastRepo = ({ user }: IssuesFromLastRepoProps) => {
7171
)}
7272
</div>
7373
<button
74+
type="button"
7475
className="absolute right-8 bottom-0 mr-4 mt-4"
7576
onClick={() => scrollHorizontally(scrollDirection.Left)}
7677
>
7778
<FaChevronRight className="b-0 w-6 h-6 rotate-180 dark:text-gray-300 bg-gray-300 dark:bg-dark-900 rounded-full p-1 font-bold" />
7879
</button>
7980
<button
81+
type="button"
8082
className="absolute right-0 bottom-0 mr-4 mt-4"
8183
onClick={() => handleScrollRight()}
8284
>

src/components/issue/IssuesFromRecentRepo.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22
import { graphql, usePaginationFragment } from 'react-relay'
33
import { IssuesFromRecentRepos$key } from '__generated__/IssuesFromRecentRepos.graphql'
4+
import Button from '../Button'
45
import Issue from './Issue'
56

67
type IssuesFromRecentReposProps = {
@@ -46,13 +47,13 @@ const IssuesFromRecentRepos = ({ user }: IssuesFromRecentReposProps) => {
4647
(issue) => issue && <Issue issue={issue.node} key={issue.node.id} />
4748
)}
4849
{hasNext ? (
49-
<button
50+
<Button
5051
onClick={() => {
5152
loadNext(3)
5253
}}
5354
>
5455
Load more
55-
</button>
56+
</Button>
5657
) : null}
5758
</div>
5859
</div>

0 commit comments

Comments
 (0)