diff --git a/__mocks__/getRepresentatives/handlers.ts b/__mocks__/getRepresentatives/handlers.ts
index f5e5c59..7bbf3fb 100644
--- a/__mocks__/getRepresentatives/handlers.ts
+++ b/__mocks__/getRepresentatives/handlers.ts
@@ -10,7 +10,6 @@ export const getRepresentativesHandlers = [
is_alternate: false,
workshop_id: BigInt(1).toString(),
email: 'john@johnson.com',
- color: '#000000',
wallet_address: 'addr1isdufnpoasidjfopmaimdfmopisadj',
name: 'John Johnson',
},
@@ -21,7 +20,6 @@ export const getRepresentativesHandlers = [
is_alternate: true,
workshop_id: BigInt(1).toString(),
email: 'mike@mickelson.com',
- color: '#000000',
wallet_address: 'addr1oqwieuroijfvaondsfipoaapoidjf',
name: 'Mike Mickelson',
},
@@ -32,7 +30,6 @@ export const getRepresentativesHandlers = [
is_alternate: false,
workshop_id: BigInt(2).toString(),
email: 'jack@jackson.com',
- color: '#000000',
wallet_address: 'addr1kidjfsadjfoadspjfoaidsfadsop',
name: 'Jack Jackson',
},
@@ -43,7 +40,6 @@ export const getRepresentativesHandlers = [
is_alternate: true,
workshop_id: BigInt(2).toString(),
email: 'rob@robertson.com',
- color: '#000000',
wallet_address: 'addr1iwoiuwqxpoieujsoidpjfkfjhpqowmfoa',
name: 'Robert Robertson',
},
@@ -54,7 +50,6 @@ export const getRepresentativesHandlers = [
is_alternate: false,
workshop_id: BigInt(3).toString(),
email: 'connor@connorson.com',
- color: '#000000',
wallet_address: 'addr1opijpoiuoimnlkjipoujpoimlkkm',
name: 'Connor Connorson',
},
@@ -65,7 +60,6 @@ export const getRepresentativesHandlers = [
is_alternate: true,
workshop_id: BigInt(3).toString(),
email: 'kyle@kyleson.com',
- color: '#000000',
wallet_address: 'addr1adfasdfwerwqersdvfzxfvsadf',
name: 'Kyle Kyleson',
},
diff --git a/__mocks__/updateUser/errorHandlers.ts b/__mocks__/updateUser/errorHandlers.ts
index 1b1ebce..10c3d96 100644
--- a/__mocks__/updateUser/errorHandlers.ts
+++ b/__mocks__/updateUser/errorHandlers.ts
@@ -4,7 +4,7 @@ export const updateUserActiveVoteHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message:
'You cannot update user information while a Poll is actively voting.',
},
@@ -17,7 +17,7 @@ export const updateUserNoNameHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Name must be provided.',
},
{ status: 400 },
@@ -29,7 +29,7 @@ export const updateUserNoEmailHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Email must be provided.',
},
{ status: 400 },
@@ -41,7 +41,7 @@ export const updateUserNoWalletAddressHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Wallet address must be provided.',
},
{ status: 400 },
@@ -53,7 +53,7 @@ export const updateUserTooLongNameHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Name must be less than 100 characters.',
},
{ status: 400 },
@@ -65,7 +65,7 @@ export const updateUserTooLongEmailHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Email must be less than 100 characters.',
},
{ status: 400 },
@@ -77,7 +77,7 @@ export const updateUserTooLongWalletAddressHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Wallet Address must be less than 100 characters.',
},
{ status: 400 },
@@ -89,7 +89,7 @@ export const updateUserInternalErrorHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- pollId: BigInt(-1).toString(),
+ userId: BigInt(-1).toString(),
message: 'Error updating User Information.',
},
{ status: 500 },
@@ -101,7 +101,7 @@ export const updateUserInvalidSessionHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- success: false,
+ userId: BigInt(-1).toString(),
message:
'You must be signed in as an Organizer update user information.',
},
@@ -114,7 +114,7 @@ export const updateUserNotOrganizerHandler = [
http.post('/api/updateUser', async () => {
return HttpResponse.json(
{
- success: false,
+ userId: BigInt(-1).toString(),
message: 'You must be an Organizer to update user information.',
},
{ status: 401 },
diff --git a/__tests__/components/coordinator/manageRepresentativesTable/stripsWhitespaceFromWalletAddress.test.tsx b/__tests__/components/coordinator/manageRepresentativesTable/stripsWhitespaceFromWalletAddress.test.tsx
new file mode 100644
index 0000000..a0bbb19
--- /dev/null
+++ b/__tests__/components/coordinator/manageRepresentativesTable/stripsWhitespaceFromWalletAddress.test.tsx
@@ -0,0 +1,33 @@
+import { render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import { Toaster } from 'react-hot-toast';
+import { expect, test } from 'vitest';
+
+import { ManageRepresentativesTable } from '@/components/coordinator/manageRepresentativesTable';
+
+test('strips whitespace from wallet address', async () => {
+ const user = userEvent.setup();
+ render(
+ <>
+
+ {}} />
+ >,
+ );
+
+ const editButton = await screen.findByTestId('edit-representative-info-1');
+ await user.click(editButton);
+
+ const input = screen.getByDisplayValue('addr1isdufnpoasidjfopmaimdfmopisadj');
+ await user.clear(input);
+ await user.type(input, ' coStakeAddress ');
+
+ const saveButton = await screen.findByTestId('save-representative-info-1');
+ await user.click(saveButton);
+
+ // Wait for the success toast to appear
+ const successToast = await screen.findByText('User info updated!');
+ expect(successToast).toBeDefined();
+
+ const newWalletAddress = await screen.findByText('coStakeAddress');
+ expect(newWalletAddress).toBeDefined();
+});
diff --git a/public/cardano.png b/public/cardano.png
new file mode 100644
index 0000000..dbdcf49
Binary files /dev/null and b/public/cardano.png differ
diff --git a/src/components/buttons/connectWalletButton.tsx b/src/components/buttons/connectWalletButton.tsx
index 21b9aff..cd4a48e 100644
--- a/src/components/buttons/connectWalletButton.tsx
+++ b/src/components/buttons/connectWalletButton.tsx
@@ -17,11 +17,16 @@ import { paths } from '@/paths';
import { connectWallet } from '@/lib/connectWallet';
import { getUser } from '@/lib/helpers/getUser';
+interface Props {
+ isHomepage?: boolean;
+}
+
/**
* A button to connect a wallet to a variety of cip-30 compatible wallets
* @returns Connect Wallet Button
*/
-export function ConnectWalletButton(): JSX.Element {
+export function ConnectWalletButton(props: Props): JSX.Element {
+ const { isHomepage } = props;
const [open, setOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState(null);
const [connecting, setConnecting] = useState(false);
@@ -192,8 +197,24 @@ export function ConnectWalletButton(): JSX.Element {
)}
- {session.status === 'authenticated' && (
+ {isHomepage ? (
+ <>>
+ ) : session.status === 'authenticated' ? (
Wallet connected
+ ) : (
+
+ Wallet not connected
+
)}
+
{wallets}
);
diff --git a/src/components/buttons/deletePollButton.tsx b/src/components/buttons/deletePollButton.tsx
index 3b9f6fc..d055f11 100644
--- a/src/components/buttons/deletePollButton.tsx
+++ b/src/components/buttons/deletePollButton.tsx
@@ -1,6 +1,5 @@
import { useState } from 'react';
import { useRouter } from 'next/router';
-import { DeleteRounded } from '@mui/icons-material';
import Button from '@mui/material/Button';
import { useSession } from 'next-auth/react';
import toast from 'react-hot-toast';
@@ -45,12 +44,12 @@ export function DeletePollButton(props: Props): JSX.Element {
return (
);
} else {
diff --git a/src/components/buttons/downloadPollVotesButton.tsx b/src/components/buttons/downloadPollVotesButton.tsx
index 3acf3bc..60acb66 100644
--- a/src/components/buttons/downloadPollVotesButton.tsx
+++ b/src/components/buttons/downloadPollVotesButton.tsx
@@ -33,11 +33,12 @@ export function DownloadPollVotesButton(props: Props): JSX.Element {
return (
);
}
diff --git a/src/components/buttons/downloadUserVotesButton.tsx b/src/components/buttons/downloadUserVotesButton.tsx
index 7f74d5d..5b43f1b 100644
--- a/src/components/buttons/downloadUserVotesButton.tsx
+++ b/src/components/buttons/downloadUserVotesButton.tsx
@@ -33,11 +33,12 @@ export function DownloadUserVotesButton(props: Props): JSX.Element {
return (
);
}
diff --git a/src/components/buttons/voteOnPollButtons.tsx b/src/components/buttons/voteOnPollButtons.tsx
index 53e6756..89cf7f9 100644
--- a/src/components/buttons/voteOnPollButtons.tsx
+++ b/src/components/buttons/voteOnPollButtons.tsx
@@ -133,7 +133,9 @@ export function VoteOnPollButtons(props: Props): JSX.Element {
variant="outlined"
color="success"
sx={{
- width: '150px',
+ width: '170px',
+ py: 2,
+ borderRadius: '60px !important',
}}
endIcon={}
size="large"
@@ -141,13 +143,16 @@ export function VoteOnPollButtons(props: Props): JSX.Element {
disabled={disabled || !isActiveVoter}
data-testid="vote-yes-button"
>
- Yes
+ Vote Yes
}
size="large"
@@ -155,12 +160,14 @@ export function VoteOnPollButtons(props: Props): JSX.Element {
disabled={disabled || !isActiveVoter}
data-testid="vote-no-button"
>
- No
+ Vote No
}
size="large"
diff --git a/src/components/coordinator/manageActivePowerTable.tsx b/src/components/coordinator/manageActivePowerTable.tsx
index b3d1af0..a4652f2 100644
--- a/src/components/coordinator/manageActivePowerTable.tsx
+++ b/src/components/coordinator/manageActivePowerTable.tsx
@@ -298,7 +298,7 @@ export function ManageActivePowerTable(props: Props): JSX.Element {
+
+
+
+
+
+ );
+}
diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx
index 3c7ab06..2c0d110 100644
--- a/src/components/layout/layout.tsx
+++ b/src/components/layout/layout.tsx
@@ -2,6 +2,7 @@ import { useTheme } from '@mui/material';
import Box from '@mui/material/Box';
import { Toaster } from 'react-hot-toast';
+import { Footer } from '@/components/layout/footer';
import { Navbar } from '@/components/layout/navbar';
interface Props {
@@ -61,6 +62,7 @@ export function Layout(props: Props): JSX.Element {
>
{children}
+
>
);
}
diff --git a/src/components/layout/navbar.tsx b/src/components/layout/navbar.tsx
index 32699d7..8c0f595 100644
--- a/src/components/layout/navbar.tsx
+++ b/src/components/layout/navbar.tsx
@@ -1,4 +1,6 @@
+import Image from 'next/image';
import Link from 'next/link';
+import ccLogo from '@/img/cc-logo.png';
import { Box, Typography } from '@mui/material';
import { paths } from '@/paths';
@@ -12,7 +14,7 @@ export function Navbar(): JSX.Element {
return (
-
-
- Voting Tool
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Voting Tool
+
+
+
+
+
);
diff --git a/src/components/polls/coordinatorViewVotes.tsx b/src/components/polls/coordinatorViewVotes.tsx
index 7c3429a..192037e 100644
--- a/src/components/polls/coordinatorViewVotes.tsx
+++ b/src/components/polls/coordinatorViewVotes.tsx
@@ -123,6 +123,7 @@ export function CoordinatorViewVotes(props: Props): JSX.Element {
row.id}
sx={{
@@ -131,7 +132,7 @@ export function CoordinatorViewVotes(props: Props): JSX.Element {
},
'.MuiDataGrid-columnHeader': {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
- fontFamily: 'Montserrat',
+ fontFamily: 'Chivo',
fontSize: '1.2rem',
},
}}
diff --git a/src/components/polls/pollCard.tsx b/src/components/polls/pollCard.tsx
index cde74bd..7d84332 100644
--- a/src/components/polls/pollCard.tsx
+++ b/src/components/polls/pollCard.tsx
@@ -1,6 +1,6 @@
import Link from 'next/link';
import { pollPhases } from '@/constants/pollPhases';
-import LaunchRounded from '@mui/icons-material/LaunchRounded';
+import { ArrowForwardRounded } from '@mui/icons-material';
import { useTheme } from '@mui/material';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
@@ -54,7 +54,7 @@ export function PollCard(props: Props): JSX.Element {
mt={2}
>
View
-
+
diff --git a/src/components/polls/pollCarrousel.tsx b/src/components/polls/pollCarrousel.tsx
index 8f41643..4bef07a 100644
--- a/src/components/polls/pollCarrousel.tsx
+++ b/src/components/polls/pollCarrousel.tsx
@@ -10,6 +10,7 @@ import { PollCard } from '@/components/polls/pollCard';
interface Props {
currentPollId: string | string[] | undefined;
polls: Poll[];
+ isPollPage?: boolean;
}
/**
@@ -19,7 +20,7 @@ interface Props {
* @returns Poll List
*/
export function PollCarrousel(props: Props): JSX.Element {
- const { currentPollId, polls } = props;
+ const { currentPollId, polls, isPollPage } = props;
let pollsToDisplay = useMemo(() => [...polls], [polls]);
@@ -63,8 +64,15 @@ export function PollCarrousel(props: Props): JSX.Element {
}}
flexDirection="column"
width="100%"
+ justifyContent="center"
>
-
+
{pollsToDisplay.map((poll) => {
return (
- Browse other polls
+ Browse {isPollPage ? 'other ' : ''}polls
{pollCards}
diff --git a/src/components/polls/pollList.tsx b/src/components/polls/pollList.tsx
index 11a4df2..da4bdd0 100644
--- a/src/components/polls/pollList.tsx
+++ b/src/components/polls/pollList.tsx
@@ -65,7 +65,13 @@ export function PollList(props: Props): JSX.Element {
wallet:
)}
-
+
{pollCards}
diff --git a/src/components/polls/pollResults.tsx b/src/components/polls/pollResults.tsx
index 0680697..d64f490 100644
--- a/src/components/polls/pollResults.tsx
+++ b/src/components/polls/pollResults.tsx
@@ -9,7 +9,6 @@ import {
LinearProgress,
linearProgressClasses,
styled,
- Tooltip,
useTheme,
} from '@mui/material';
import Box from '@mui/material/Box';
@@ -169,7 +168,12 @@ export function PollResults(props: Props): JSX.Element {
return (
-
+
Results
diff --git a/src/components/representatives/representativesTable.tsx b/src/components/representatives/representativesTable.tsx
index 9fbc4b3..d157ad1 100644
--- a/src/components/representatives/representativesTable.tsx
+++ b/src/components/representatives/representativesTable.tsx
@@ -1,11 +1,11 @@
import Link from 'next/link';
-import LaunchRounded from '@mui/icons-material/LaunchRounded';
import { Box, useTheme } from '@mui/material';
import Typography from '@mui/material/Typography';
import { DataGrid, GridColDef } from '@mui/x-data-grid';
import type { User, Workshop } from '@/types';
import { paths } from '@/paths';
+import { abbreviateName } from '@/lib/helpers/abbreviateName';
interface Props {
representatives: User[];
@@ -30,9 +30,17 @@ export function RepresentativesTable(props: Props): JSX.Element {
headerName: 'Name',
minWidth: 125,
flex: 1,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ Workshop
+
+ );
+ },
renderCell: (params): JSX.Element => {
return {params.row.name};
},
+ disableColumnMenu: true,
},
{
field: 'Delegate',
@@ -41,10 +49,19 @@ export function RepresentativesTable(props: Props): JSX.Element {
flex: 1,
sortable: false,
filterable: false,
+ disableColumnMenu: true,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ Delegate
+
+ );
+ },
renderCell: (params): JSX.Element => {
const delegateId = params.row.delegate_id;
const delegate = representatives.find((rep) => rep.id === delegateId);
const activeVoterId = params.row.active_voter_id;
+ const name = abbreviateName(delegate?.name || '');
return (
- {delegate?.name}
+ {name}
-
);
@@ -90,10 +106,19 @@ export function RepresentativesTable(props: Props): JSX.Element {
flex: 1,
sortable: false,
filterable: false,
+ disableColumnMenu: true,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ Alternate
+
+ );
+ },
renderCell: (params): JSX.Element => {
const alternateId = params.row.alternate_id;
const alternate = representatives.find((rep) => rep.id === alternateId);
const activeVoterId = params.row.active_voter_id;
+ const name = abbreviateName(alternate?.name || '');
return (
- {alternate?.name}
+ {name}
-
);
@@ -141,11 +165,20 @@ export function RepresentativesTable(props: Props): JSX.Element {
flex: 1,
sortable: false,
filterable: false,
+ disableColumnMenu: true,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ Active Voter
+
+ );
+ },
renderCell: (params): JSX.Element => {
const activeVoterId = params.row.active_voter_id;
const activeVoter = representatives.find(
(rep) => rep.id === activeVoterId,
);
+ const name = abbreviateName(activeVoter?.name || '');
return (
- {activeVoter?.name}
-
+ {name}
);
@@ -192,7 +224,7 @@ export function RepresentativesTable(props: Props): JSX.Element {
diff --git a/src/components/representatives/votingHistoryTable.tsx b/src/components/representatives/votingHistoryTable.tsx
index 8e16c88..5aa9def 100644
--- a/src/components/representatives/votingHistoryTable.tsx
+++ b/src/components/representatives/votingHistoryTable.tsx
@@ -2,6 +2,7 @@ import { pollPhases } from '@/constants/pollPhases';
import DoDisturbRounded from '@mui/icons-material/DoDisturbRounded';
import ThumbDownRounded from '@mui/icons-material/ThumbDownRounded';
import ThumbUpRounded from '@mui/icons-material/ThumbUpRounded';
+import { useTheme } from '@mui/material';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { DataGrid, GridColDef } from '@mui/x-data-grid';
@@ -26,19 +27,54 @@ interface Props {
export function VotingHistoryTable(props: Props): JSX.Element {
const { userId, votes, polls } = props;
+ const theme = useTheme();
+
const columns: GridColDef[] = [
- { field: 'id', headerName: '#' },
+ {
+ field: 'id',
+ headerName: '#',
+ disableColumnMenu: true,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ Poll #
+
+ );
+ },
+ renderCell: (params): JSX.Element => {
+ return {params.row.id};
+ },
+ },
{
field: 'name',
headerName: 'Name',
minWidth: 150,
flex: 1,
+ disableColumnMenu: true,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ Poll Name
+
+ );
+ },
+ renderCell: (params): JSX.Element => {
+ return {params.row.name};
+ },
},
{
field: 'user_vote',
headerName: 'User Vote',
minWidth: 150,
flex: 1,
+ disableColumnMenu: true,
+ renderHeader: (): JSX.Element => {
+ return (
+
+ User Vote
+
+ );
+ },
renderCell: (params): JSX.Element => {
const userVoteData = votes.find(
(vote) => vote.poll_id === params.row.id,
@@ -89,28 +125,34 @@ export function VotingHistoryTable(props: Props): JSX.Element {
return (
-
- Voting History
+
+ History
diff --git a/src/img/Clarity.png b/src/img/Clarity.png
new file mode 100644
index 0000000..7e53fbc
Binary files /dev/null and b/src/img/Clarity.png differ
diff --git a/src/img/cc-logo.png b/src/img/cc-logo.png
new file mode 100644
index 0000000..5ce4afc
Binary files /dev/null and b/src/img/cc-logo.png differ
diff --git a/src/lib/helpers/abbreviateName.ts b/src/lib/helpers/abbreviateName.ts
new file mode 100644
index 0000000..1a08712
--- /dev/null
+++ b/src/lib/helpers/abbreviateName.ts
@@ -0,0 +1,14 @@
+export function abbreviateName(fullName: string) {
+ const nameParts = fullName.split(' ');
+ if (nameParts.length < 2) {
+ return fullName; // If there's no last name, return the original name
+ }
+
+ const lastName = nameParts[nameParts.length - 1];
+ const initials = nameParts
+ .slice(0, -1)
+ .map((name) => name[0].toUpperCase() + '.')
+ .join('');
+
+ return `${initials} ${lastName}`;
+}
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
new file mode 100644
index 0000000..a0b861f
--- /dev/null
+++ b/src/pages/404.tsx
@@ -0,0 +1,37 @@
+import Head from 'next/head';
+import Link from 'next/link';
+import HomeRounded from '@mui/icons-material/HomeRounded';
+import { Box, Button, Typography } from '@mui/material';
+
+export default function Custom404(): JSX.Element {
+ return (
+ <>
+
+ Constitutional Convention Voting App
+
+
+
+
+
+
+ 404 - Page Not Found
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
index c916115..10d5646 100644
--- a/src/pages/_document.tsx
+++ b/src/pages/_document.tsx
@@ -9,11 +9,7 @@ export default function Document(): JSX.Element {
-
diff --git a/src/pages/api/auth/[...nextauth].ts b/src/pages/api/auth/[...nextauth].ts
index 8620890..caffa13 100644
--- a/src/pages/api/auth/[...nextauth].ts
+++ b/src/pages/api/auth/[...nextauth].ts
@@ -51,6 +51,7 @@ export const authOptions: NextAuthOptions = {
isCoordinator: user.is_convention_organizer,
isDelegate: user.is_delegate,
isAlternate: user.is_alternate,
+ name: user.name,
};
} else {
return null;
@@ -65,6 +66,7 @@ export const authOptions: NextAuthOptions = {
async jwt({ token, user }) {
if (user) {
token.stakeAddress = user.stakeAddress;
+ token.name = user.name;
token.walletName = user.walletName;
token.isCoordinator = user.isCoordinator;
token.isDelegate = user.isDelegate;
@@ -75,6 +77,9 @@ export const authOptions: NextAuthOptions = {
async session({ session, token }) {
if (typeof token.walletName === 'string')
session.user.walletName = token.walletName;
+ if (typeof token.name === 'string') {
+ session.user.name = token.name;
+ }
if (typeof token.isCoordinator === 'boolean')
session.user.isCoordinator = token.isCoordinator;
if (typeof token.isDelegate === 'boolean')
diff --git a/src/pages/api/updateUser.ts b/src/pages/api/updateUser.ts
index 85c52f5..e38456e 100644
--- a/src/pages/api/updateUser.ts
+++ b/src/pages/api/updateUser.ts
@@ -107,7 +107,7 @@ export default async function updateUser(
data: {
name: name,
email: email,
- wallet_address: wallet_address,
+ wallet_address: wallet_address.trim(),
},
});
return res.status(200).json({
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 698a535..af881f7 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -34,13 +34,10 @@ export default function Home(props: Props): JSX.Element {
content="Voting app to be used by delegates at the Cardano Constitutional Convention in Buenos Aires to ratify the initial constitution. This voting app was commissioned by Intersect."
/>
-
+
-
+
)}
-
+
Welcome to the Constitutional Convention Voting Tool
Are you a delegate?
-
+
Connect a wallet to cast your vote:
-
+ {session.status === 'unauthenticated' && (
+
+ )}
@@ -142,10 +152,7 @@ export default function ViewPoll(props: Props): JSX.Element {
content="Voting app to be used by delegates at the Cardano Constitutional Convention in Buenos Aires to ratify the initial constitution. This voting app was commissioned by Intersect."
/>
-
+
@@ -281,7 +288,9 @@ export default function ViewPoll(props: Props): JSX.Element {
setIsTxUploading={updateIsTxUploading}
/>
)}
-
+
>
)}
@@ -323,7 +332,11 @@ export default function ViewPoll(props: Props): JSX.Element {
{/* Browse Other Polls Carrousel */}
-
+
+
+
+
+ Are you sure you want to delete this Poll?
+
+
+
+
+
+
+
>
);
diff --git a/src/pages/polls/new.tsx b/src/pages/polls/new.tsx
index 28fc075..be734b3 100644
--- a/src/pages/polls/new.tsx
+++ b/src/pages/polls/new.tsx
@@ -38,10 +38,7 @@ export default function NewPoll(props: Props): JSX.Element {
content="Voting app to be used by delegates at the Cardano Constitutional Convention in Buenos Aires to ratify the initial constitution. This voting app was commissioned by Intersect."
/>
-
+
diff --git a/src/pages/representatives/[userId]/index.tsx b/src/pages/representatives/[userId]/index.tsx
index 61434fa..813269d 100644
--- a/src/pages/representatives/[userId]/index.tsx
+++ b/src/pages/representatives/[userId]/index.tsx
@@ -55,10 +55,7 @@ export default function Representative(props: Props): JSX.Element {
content="Voting app to be used by delegates at the Cardano Constitutional Convention in Buenos Aires to ratify the initial constitution. This voting app was commissioned by Intersect."
/>
-
+
@@ -128,20 +125,12 @@ export default function Representative(props: Props): JSX.Element {
color={theme.palette.text.primary}
>
-
+
{userVotes.length} vote
- {userVotes.length === 1 ? '' : 's'}
+ {userVotes.length === 1 ? '' : 's'} cast
-
+
{workshopName || 'Failed to retrieve workshop'}
@@ -163,6 +152,12 @@ export default function Representative(props: Props): JSX.Element {
xs: 12,
md: 6,
}}
+ sx={{
+ mt: {
+ xs: 6,
+ md: 0,
+ },
+ }}
>
-
+
diff --git a/src/providers/themeProvider.tsx b/src/providers/themeProvider.tsx
index e44d460..c3f0226 100644
--- a/src/providers/themeProvider.tsx
+++ b/src/providers/themeProvider.tsx
@@ -17,7 +17,7 @@ export function ColorModeProvider({
}): JSX.Element {
const theme = createTheme({
shape: {
- borderRadius: 4,
+ borderRadius: 8,
},
palette: {
// palette values for light mode
@@ -75,7 +75,7 @@ export function ColorModeProvider({
styleOverrides: {
root: {
textTransform: 'unset',
- fontFamily: 'Inter',
+ fontFamily: 'Chivo',
borderRadius: '24px',
padding: '10px 30px',
fontWeight: 600,
@@ -89,7 +89,7 @@ export function ColorModeProvider({
backgroundColor: 'rgba(77,166,77, 0.1)',
},
outlinedWarning: {
- border: '1px solid rgb(245, 148, 77)',
+ border: '1px solid rgba(255,255,255, .10)',
backgroundColor: 'rgba(245, 148, 77, 0.1)',
},
outlinedPrimary: {
@@ -197,9 +197,8 @@ export function ColorModeProvider({
},
},
typography: {
- fontFamily: 'Montserrat',
+ fontFamily: 'Chivo',
button: {
- fontFamily: 'Inter',
fontWeight: 400,
lineHeight: 1.5,
},
@@ -228,11 +227,11 @@ export function ColorModeProvider({
color: '#FFFFFF',
},
body1: {
- fontFamily: 'Inter',
+ fontFamily: 'Chivo',
color: '#FFFFFF',
},
body2: {
- fontFamily: 'Inter',
+ fontFamily: 'Chivo',
color: '#FFFFFF',
},
},