Skip to content

Commit

Permalink
EditDialog: Add controlled accordion for members
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik committed Jan 29, 2025
1 parent f833f9d commit 78f9006
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const getData = (numberOfWikimediaItems: number, isClimbingRoute?: boolean) => {
.fill('')
.reduce((acc, _, index) => {
const key = getWikimediaCommonsKey(index);
const value = `Wikimedia commons photo (${index})`;
const value = `${t('tags.wikimedia_commons_photo')} (${index})`;
return { ...acc, [key]: value };
}, {});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const MembersEditor = () => {
const theme = useTheme();
const handleClick = useGetHandleClick();
const isClimbingCrag = tags.climbing === 'crag';
const [isExpanded, setIsExpanded] = React.useState(false);

const getSectionName = () => {
const isClimbingArea = tags.climbing === 'area';
Expand All @@ -40,11 +41,12 @@ export const MembersEditor = () => {
children: React.ReactNode;
membersLength?: number;
}) => (
<Accordion disableGutters elevation={0} square>
<Accordion disableGutters elevation={0} square expanded={isExpanded}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1-content"
id="panel1-header"
onClick={() => setIsExpanded(!isExpanded)}
>
<Stack direction="row" spacing={2} alignItems="center">
<Typography variant="button">{getSectionName()}</Typography>
Expand Down
1 change: 1 addition & 0 deletions src/locales/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export default {
'tags.climbing_grade_french': 'Francouzská klasifikace',
'tags.climbing_boulder': 'Boulder',
'tags.length': 'Délka',
'tags.wikimedia_commons_photo': 'Wikimedia Commons fotka',

'coordinates.geo_uri': 'GeoURI (mapová appka v telefonu)',

Expand Down
1 change: 1 addition & 0 deletions src/locales/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export default {
'tags.climbing_grade_french': 'French climbing grade',
'tags.climbing_boulder': 'Boulder',
'tags.length': 'Length',
'tags.wikimedia_commons_photo': 'Wikimedia Commons photo',

'coordinates.geo_uri': 'GeoURI (phone map app)',

Expand Down

0 comments on commit 78f9006

Please sign in to comment.