Skip to content

Commit

Permalink
478 implement text changes (#481)
Browse files Browse the repository at this point in the history
* Changes to join public group

* Update texts

* WIP

* Latest text changes
  • Loading branch information
camilovegag authored May 16, 2024
1 parent cfe4337 commit e52d884
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 44 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
4 changes: 1 addition & 3 deletions packages/berlin/src/components/secret-code/SecretCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ function SecretCode({ groupName, secretCode }: SecretCodeProps) {
};
return (
<SecretCodeContainer>
<Body>
Secret code for <i>{groupName}</i> research group:
</Body>
<Body>Access code for {groupName} research group</Body>
<FlexRow $align="center" $justify="space-between">
<Subtitle>{secretCode}</Subtitle>
<IconButton
Expand Down
26 changes: 7 additions & 19 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: 'Share the access code with your collaborators',
},
],
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 @@ -29,16 +22,11 @@ const groups = {
},
join: {
subtitle: 'Join a Research Group',
body: [
{
id: 0,
text: 'As a collaborator, you can join a research group. Please ask to your Lead Researcher for the group code.',
},
],
body: [],
input: {
label: 'Research Group Code',
placeholder: 'Enter the secret code here...',
requiredMessage: 'Code is required',
label: 'Ask the group creator for the access code',
placeholder: 'Enter access code',
requiredMessage: 'Access code is required',
},
buttonText: 'Join group',
},
Expand Down
8 changes: 0 additions & 8 deletions packages/berlin/src/data/publicGroups.ts

This file was deleted.

10 changes: 1 addition & 9 deletions packages/berlin/src/pages/PublicGroupRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ import useUser from '../hooks/useUser';
// API
import { fetchGroups, postUsersToGroups, fetchUsersToGroups, putUsersToGroups } from 'api';

// Data
import publicGroups from '../data/publicGroups';

// Components
import { Body } from '../components/typography/Body.styled';
import { FlexColumn } from '../components/containers/FlexColum.styled';
import { Form } from '../components/containers/Form.styled';
import { Subtitle } from '../components/typography/Subtitle.styled';
import Button from '../components/button';
import Select from '../components/select';
import { useMemo } from 'react';
Expand Down Expand Up @@ -133,8 +128,6 @@ function PublicGroupRegistration() {

return (
<FlexColumn $gap="1.5rem">
<Subtitle>{publicGroups.copy.subtitle}</Subtitle>
<Body>{publicGroups.copy.body}</Body>
<Form onSubmit={handleSubmit(onSubmit)}>
<Controller
name="group"
Expand All @@ -144,11 +137,10 @@ function PublicGroupRegistration() {
}}
render={({ field }) => (
<Select
label={`${capitalizedParam} group`}
placeholder={
prevUserToGroup
? prevUserToGroup.group.name
: `Select a ${groupCategoryNameParam} group`
: `Select your ${groupCategoryNameParam} group`
}
options={selectData}
value={field.value}
Expand Down
2 changes: 0 additions & 2 deletions packages/berlin/src/pages/SecretGroupRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ function SecretGroupRegistration() {
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 e52d884

Please sign in to comment.