Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
henrycatalinismith committed May 22, 2024
1 parent 5202b62 commit 1afa125
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 33 deletions.
6 changes: 3 additions & 3 deletions webapp/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { ServerConfig } from '@/utils/serverConfig';
// time instead of at runtime. That doesn't work: this page needs to fetch
// project-specific config files and perform git operations. So this little
// one-liner forces it into dynamic rendering mode.
//
//
// More info on dynamic vs static rendering at:
// https://nextjs.org/learn/dashboard-app/static-and-dynamic-rendering
//
//
// More info on `export const dynamic` at:
// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
export const dynamic = "force-dynamic";
export const dynamic = 'force-dynamic';

export default async function Home() {
const serverConfig = await ServerConfig.read();
Expand Down
6 changes: 5 additions & 1 deletion webapp/src/components/MessageForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ type MessageFormProps = {
* the source code on the left for reference, and the current translation on the
* right.
*/
const MessageForm: FC<MessageFormProps> = ({ message, onSave, translation }) => {
const MessageForm: FC<MessageFormProps> = ({
message,
onSave,
translation,
}) => {
const [text, setText] = useState(translation);

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ const ProjectCard: FC<ProjectCardProps> = ({
</Link>
<LinearProgress
determinate
size='lg'
size="lg"
sx={{ backgroundColor: '#ffffff' }}
thickness={8}
value={Math.min(progress, 100)}
variant='outlined'
variant="outlined"
/>
</Box>
</Box>
Expand Down
74 changes: 50 additions & 24 deletions webapp/src/stories/MessageForm.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,62 @@
import MessageForm from "@/components/MessageForm";
import MessageForm from '@/components/MessageForm';

const stories = {
component: MessageForm,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
title: "MessageForm",
}
title: 'MessageForm',
};

export const Default = () => <MessageForm message={{
defaultMessage: 'message.defaultMessage',
id: 'message.id',
params: [],
}} onSave={() => {}} translation="translation" />
export const Default = () => (
<MessageForm
message={{
defaultMessage: 'message.defaultMessage',
id: 'message.id',
params: [],
}}
onSave={() => {}}
translation="translation"
/>
);

export const LongDefaultMessage = () => <MessageForm message={{
defaultMessage: 'Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation.',
id: 'message.id',
params: [],
}} onSave={() => {}} translation="translation" />
export const LongDefaultMessage = () => (
<MessageForm
message={{
defaultMessage:
'Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation.',
id: 'message.id',
params: [],
}}
onSave={() => {}}
translation="translation"
/>
);

export const LongTranslationString = () => <MessageForm message={{
defaultMessage: 'defaultMessage',
id: 'message.id',
params: [],
}} onSave={() => {}} translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation." />
export const LongTranslationString = () => (
<MessageForm
message={{
defaultMessage: 'defaultMessage',
id: 'message.id',
params: [],
}}
onSave={() => {}}
translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation."
/>
);

export const LongDefaultAndTranslation = () => <MessageForm message={{
defaultMessage: 'Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation.',
id: 'message.id',
params: [],
}} onSave={() => {}} translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation." />
export const LongDefaultAndTranslation = () => (
<MessageForm
message={{
defaultMessage:
'Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation.',
id: 'message.id',
params: [],
}}
onSave={() => {}}
translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation."
/>
);

export default stories
export default stories;
4 changes: 1 addition & 3 deletions webapp/src/stories/ProjectCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export const Gen2 = () => (
<Box width="300px">
<ProjectCard
href="/projects/gen2"
languages={[
{ href: '/projects/gen3/en', language: 'en', progress: 0 },
]}
languages={[{ href: '/projects/gen3/en', language: 'en', progress: 0 }]}
messageCount={99999999999}
name="Gen2"
/>
Expand Down

0 comments on commit 1afa125

Please sign in to comment.