Skip to content

Commit

Permalink
Update texts
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag committed May 16, 2024
1 parent e11740d commit 80b0add
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/berlin/src/components/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { DialogContent, DialogOverlay } from './Dialog.styled';

type DialogProps = {
trigger?: React.ReactNode;
title: string;
title?: string;
description?: string;
content?: React.ReactNode;
dialogButtons?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { FlexRow } from '../containers/FlexRow.styled';
type ResearchGroupFormProps = {
formData: {
input: {
label: string;
placeholder: string;
requiredMessage: string;
};
Expand Down Expand Up @@ -48,7 +47,6 @@ function ResearchGroupForm({ formData, handleCreateGroup, setGroupName }: Resear
return (
<Form onSubmit={handleSubmit(onSubmit)}>
<Input
label={formData.input.label}
placeholder={formData.input.placeholder}
autoComplete="off"
{...register('name', {
Expand Down
7 changes: 2 additions & 5 deletions packages/berlin/src/components/secret-code/SecretCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import { Subtitle } from '../typography/Subtitle.styled';
import IconButton from '../icon-button';

type SecretCodeProps = {
groupName: string;
secretCode: string;
};

function SecretCode({ groupName, secretCode }: SecretCodeProps) {
function SecretCode({ secretCode }: SecretCodeProps) {
const theme = useAppStore((state) => state.theme);

const handleCopyButtonClick = () => {
Expand All @@ -21,9 +20,7 @@ function SecretCode({ groupName, secretCode }: SecretCodeProps) {
};
return (
<SecretCodeContainer>
<Body>
Secret code for <i>{groupName}</i> research group:
</Body>
<Body>Share this code with your collaborators:</Body>
<FlexRow $align="center" $justify="space-between">
<Subtitle>{secretCode}</Subtitle>
<IconButton
Expand Down
17 changes: 5 additions & 12 deletions packages/berlin/src/data/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,16 @@ const groups = {
body: [
{
id: 0,
text: 'If you are the Lead Researcher or a Solo Researcher, please create a research group.',
},
{
id: 1,
text: 'You will get a code that you can share with your collaborators.',
text: '(For Lead & Solo Researchers)',
},
],
buttonText: 'Create group',
dialog: {
title: 'Do you want to create a Research Group?',
description: 'This action will create a Research Group and join you to it.',
actionButtonText: 'Create group',
form: {
input: {
label: 'Research Group name',
placeholder: 'Enter your group name',
requiredMessage: 'Group name must be 2 characters long or more',
placeholder: 'Research group name',
requiredMessage: 'Research group name must be 2 characters long or more',
},
buttonText: 'Create group',
},
Expand All @@ -32,11 +25,11 @@ const groups = {
body: [
{
id: 0,
text: 'As a collaborator, you can join a research group. Please ask to your Lead Researcher for the group code.',
text: '(For Collaborators)',
},
],
input: {
label: 'Research Group Code',
label: 'Ask your Lead Researchers for a Code',
placeholder: 'Enter the secret code here...',
requiredMessage: 'Code is required',
},
Expand Down
4 changes: 1 addition & 3 deletions packages/berlin/src/pages/SecretGroupRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,13 @@ function SecretGroupRegistration() {
{groups.create.body.map(({ id, text }) => (
<Body key={id}>{text}</Body>
))}
{groupName && secretCode && <SecretCode groupName={groupName} secretCode={secretCode} />}
{groupName && secretCode && <SecretCode secretCode={secretCode} />}
<Dialog
open={isDialogOpen}
onOpenChange={setIsDialogOpen}
trigger={
<Button onClick={() => setIsDialogOpen(true)}>{groups.create.buttonText}</Button>
}
title={groups.create.dialog.title}
description={groups.create.dialog.description}
content={
<ResearchGroupForm
formData={groups.create.dialog.form}
Expand Down

0 comments on commit 80b0add

Please sign in to comment.