language conditional sort for signup form buttons
This commit is contained in:
@@ -99,13 +99,15 @@ const EventPageView: React.FC<EventPageViewProps> = ({ event }) => {
|
||||
</p>
|
||||
{/* We may have multiple signup forms. Generate own Button for each one */}
|
||||
<SignupButtons>
|
||||
{event.signupForm.sort((a, b) => (a.title_fi.localeCompare(b.title_fi))).map((sf) => (
|
||||
<Link key={sf.id} to={`/signup/${sf.id}`}>
|
||||
<Button data-e2e="signup-button" buttonStyle="filled" onClick={noop}>
|
||||
{isFi ? sf.title_fi : sf.title_en}
|
||||
</Button>
|
||||
</Link>
|
||||
))}
|
||||
{event.signupForm
|
||||
.sort((a, b) => (isFi ? a.title_fi.localeCompare(b.title_fi) : a.title_en.localeCompare(b.title_en)))
|
||||
.map((sf) => (
|
||||
<Link key={sf.id} to={`/signup/${sf.id}`}>
|
||||
<Button data-e2e="signup-button" buttonStyle="filled" onClick={noop}>
|
||||
{isFi ? sf.title_fi : sf.title_en}
|
||||
</Button>
|
||||
</Link>
|
||||
))}
|
||||
</SignupButtons>
|
||||
</div>
|
||||
</StyledTextSection>
|
||||
|
||||
Reference in New Issue
Block a user