Skip to content

Commit

Permalink
Merge branch '445-update-secret-groups-page' into diego/support-multi…
Browse files Browse the repository at this point in the history
…ple-groups-per-category
  • Loading branch information
diegoalzate committed May 14, 2024
2 parents e99b59a + ca4de92 commit 07f0903
Show file tree
Hide file tree
Showing 51 changed files with 463 additions and 327 deletions.
1 change: 1 addition & 0 deletions packages/api/src/types/ForumQuestionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type GetForumQuestionStatisticsResponse = {
optionSubTitle: string;
distinctGroups: number;
listOfGroupNames: string[];
quadraticScore: string;
}
>;
};
Expand Down
9 changes: 6 additions & 3 deletions packages/api/src/types/GroupType.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
export type GetGroupsResponse = {
id: string;
name: string;
description: string;
description: string | null;
secret: string | null;
createdAt: string;
updatedAt: string;
groupCategoryId?: string;
groupCategory?: {
createdAt: string;
eventId: string;
id: string;
name: string;
eventId: string;
userCanCreate: boolean;
userCanView: boolean;
createdAt: string;
updatedAt: string;
};
};
Expand Down
3 changes: 3 additions & 0 deletions packages/berlin/public/icons/money-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/berlin/public/icons/money-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/berlin/public/icons/sqrt-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/berlin/public/icons/sqrt-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { Grid } from '../containers/Grid.styled';
import { Body } from '../typography/Body.styled';
import { Grid } from '../../containers/Grid.styled';
import { Body } from '../../typography/Body.styled';

export const Card = styled(Grid)`
border-bottom: 2px solid var(--color-black);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { FlexRow } from '../containers/FlexRow.styled';
import { FlexRow } from '../../containers/FlexRow.styled';

export const Card = styled(FlexRow)`
border-bottom: 2px solid var(--color-black);
Expand Down Expand Up @@ -53,7 +53,7 @@ export const Hearts = styled(FlexRow)`
padding: 1.5rem;
`;

export const Plurality = styled(FlexRow)`
max-width: 5.5rem;
padding: 1.5rem;
`;
// export const Plurality = styled(FlexRow)`
// max-width: 5.5rem;
// padding: 1.5rem;
// `;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IconButton from '../icon-button';
import { Body } from '../typography/Body.styled';
import { Affiliation, Author, Card, Hearts, Plurality, Proposal } from './CycleColumns.styled';
import IconButton from '../../icon-button';
import { Body } from '../../typography/Body.styled';
import { Affiliation, Author, Card, Hearts, Proposal } from './CycleColumns.styled';

type CycleColumnsProps = {
onColumnClick: (column: string) => void;
Expand All @@ -25,13 +25,13 @@ function CycleColumns({ onColumnClick }: CycleColumnsProps) {
icon={{ src: `/icons/heart-full.svg`, alt: 'Full heart' }}
/>
</Hearts>
<Plurality onClick={() => onColumnClick('voteScore')}>
{/* <Plurality onClick={() => onColumnClick('voteScore')}>
<IconButton
$padding={0}
$color="secondary"
icon={{ src: `/icons/plurality-score.svg`, alt: 'Plurality score' }}
/>
</Plurality>
</Plurality> */}
</Card>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styled from 'styled-components';
import { Body } from '../../typography/Body.styled';
import { Grid } from '../../containers/Grid.styled';

export const Card = styled(Grid)`
border-bottom: 2px solid var(--color-black);
gap: 0;
grid-template-columns: repeat(2, 1fr) 82px;
width: 100%;
padding: 1.5rem;
`;

export const Group = styled(Body)`
font-weight: bold;
`;

export const Secret = styled(Body)`
font-weight: bold;
`;

export const Action = styled(Body)`
font-weight: bold;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Action, Card, Group, Secret } from './GroupsColumns.styled';

function GroupsColumns() {
return (
<Card>
<Group>Group</Group>
<Secret>Secret</Secret>
<Action>Action</Action>
</Card>
);
}

export default GroupsColumns;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './GroupsColumns';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styled from 'styled-components';
import { Grid } from '../../containers/Grid.styled';

export const Card = styled(Grid)`
border-bottom: 2px solid var(--color-black);
padding: 1.5rem;
grid-template-columns: auto repeat(3, 48px) 80px;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useAppStore } from '../../../store';
import IconButton from '../../icon-button';
import { Bold } from '../../typography/Bold.styled';
import { Card } from './ResultsColumns.styled';

function ResultsColumns() {
const theme = useAppStore((state) => state.theme);
return (
<Card>
<Bold>Title</Bold>
<IconButton
$padding={0}
$color="secondary"
icon={{ src: `/icons/heart-full.svg`, alt: 'Hearts' }}
/>
<IconButton
$padding={0}
$color="secondary"
icon={{ src: `/icons/sqrt-${theme}.svg`, alt: 'Quadratic score' }}
/>
<IconButton
$padding={0}
$color="secondary"
icon={{ src: `/icons/plurality-score.svg`, alt: 'Plurality score' }}
/>
<IconButton
$padding={0}
$color="secondary"
icon={{ src: `/logos/arbitrum-${theme}.svg`, alt: 'Arbitrum' }}
/>
</Card>
);
}

export default ResultsColumns;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './ResultsColumns';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styled from 'styled-components';
import { Grid } from '../../containers/Grid.styled';

export const Card = styled(Grid)`
border-bottom: 2px solid var(--color-black);
padding: 1.5rem;
grid-template-columns: auto 240px;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Bold } from '../../typography/Bold.styled';
import { Card } from './StatsColumns.styled';

function StatsColumns() {
return (
<Card>
<Bold>Statistic</Bold>
<Bold>Value</Bold>
</Card>
);
}

export default StatsColumns;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './StatsColumns';
1 change: 0 additions & 1 deletion packages/berlin/src/components/comment-card/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/berlin/src/components/cycle-card/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Votes = styled(FlexRow)`
padding: 1.5rem;
`;

export const Plurality = styled(FlexRow)`
max-width: 5.5rem;
padding: 1.5rem;
`;
// export const Plurality = styled(FlexRow)`
// max-width: 5.5rem;
// padding: 1.5rem;
// `;
26 changes: 13 additions & 13 deletions packages/berlin/src/components/option-card/OptionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useMemo, useState } from 'react';
import { Body } from '../typography/Body.styled';
import { Affiliation, Author, Card, Votes, Plurality, Proposal } from './OptionCard.styled';
import { FlexColumn } from '../containers/FlexColum.styled';
import IconButton from '../icon-button';
import { useAppStore } from '../../store';
import { FlexRow } from '../containers/FlexRow.styled';
import { QuestionOption } from 'api';
import { useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { useAppStore } from '../../store';
import { FlexColumn } from '../containers/FlexColum.styled';
import { FlexRow } from '../containers/FlexRow.styled';
import IconButton from '../icon-button';
import { Body } from '../typography/Body.styled';
import { Affiliation, Author, Card, Proposal, Votes } from './OptionCard.styled';

type OptionCardProps = {
option: QuestionOption;
Expand All @@ -18,10 +18,10 @@ function OptionCard({ option, numOfVotes, onVote, onUnvote }: OptionCardProps) {
const { eventId, cycleId } = useParams();
const theme = useAppStore((state) => state.theme);
const navigate = useNavigate();
const formattedPluralityScore = useMemo(() => {
const score = parseFloat(String(option.voteScore));
return score % 1 === 0 ? score.toFixed(0) : score.toFixed(1);
}, [option.voteScore]);
// const formattedPluralityScore = useMemo(() => {
// const score = parseFloat(String(option.voteScore));
// return score % 1 === 0 ? score.toFixed(0) : score.toFixed(1);
// }, [option.voteScore]);

const [expanded, setExpanded] = useState(false);

Expand Down Expand Up @@ -75,9 +75,9 @@ function OptionCard({ option, numOfVotes, onVote, onUnvote }: OptionCardProps) {
</FlexColumn>
<Body>{numOfVotes}</Body>
</Votes>
<Plurality>
{/* <Plurality>
<Body>{formattedPluralityScore}</Body>
</Plurality>
</Plurality> */}
</FlexRow>
<FlexColumn className="description" $gap="1.5rem">
{option.optionSubTitle && <Body>{option.optionSubTitle}</Body>}
Expand Down
37 changes: 0 additions & 37 deletions packages/berlin/src/components/result-card/ResultCard.styled.tsx

This file was deleted.

Loading

0 comments on commit 07f0903

Please sign in to comment.