Skip to content

Commit

Permalink
Change upcoming to open & past to closed (#748)
Browse files Browse the repository at this point in the history
* Change upcoming to open at event page

* Change past to closed
  • Loading branch information
camilovegag authored Aug 6, 2024
1 parent 2282322 commit 849729d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/berlin/src/pages/Event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Event() {
);

const initialTab = useMemo(
() => (openCycles && openCycles.length > 0 ? 'upcoming' : 'past'),
() => (openCycles && openCycles.length > 0 ? 'open' : 'closed'),
[openCycles],
);

Expand Down Expand Up @@ -117,28 +117,28 @@ function Questions({
}) {
const [activeTab, setActiveTab] = useState<string>(initialTab);

const tabNames = ['upcoming', 'past'];
const tabNames = ['open', 'closed'];

const tabs = {
upcoming: (
open: (
<Cycles
cycles={openCycles}
eventId={eventId}
fallback={{
message: 'No upcoming questions available.',
buttonMessage: 'Past questions',
buttonOnClick: () => setActiveTab('past'),
message: 'No open questions available.',
buttonMessage: 'Closed questions',
buttonOnClick: () => setActiveTab('closed'),
}}
/>
),
past: (
closed: (
<Cycles
cycles={closedCycles}
eventId={eventId}
fallback={{
message: 'No past questions available.',
buttonMessage: 'Upcoming questions',
buttonOnClick: () => setActiveTab('upcoming'),
message: 'No closed questions available.',
buttonMessage: 'Open questions',
buttonOnClick: () => setActiveTab('open'),
}}
/>
),
Expand Down

0 comments on commit 849729d

Please sign in to comment.