-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Show Admin Link in Mobile Nav * Create all Available Actions * Delete admin store page * Update src/pages/admin/milestone.tsx Co-authored-by: Alex Zhang <[email protected]> --------- Co-authored-by: Alex Zhang <[email protected]>
- Loading branch information
1 parent
dd7eaae
commit 26bead4
Showing
19 changed files
with
477 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export type Styles = { | ||
subtitle: string; | ||
title: string; | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { URL } from '@/lib/types'; | ||
import Link from 'next/link'; | ||
import { PropsWithChildren } from 'react'; | ||
import style from './style.module.scss'; | ||
|
||
interface IProps { | ||
variant?: 'primary' | 'secondary'; | ||
destructive?: boolean; | ||
href: URL; | ||
size?: 'default' | 'small'; | ||
} | ||
|
||
const LinkButton = (props: PropsWithChildren<IProps>) => { | ||
const { variant = 'primary', destructive = false, href, size = 'default', children } = props; | ||
|
||
return ( | ||
<Link | ||
className={style.button} | ||
data-variant={variant} | ||
data-destructive={destructive} | ||
data-size={size} | ||
href={href} | ||
> | ||
{children} | ||
</Link> | ||
); | ||
}; | ||
|
||
export default LinkButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@use '../../../styles/vars.scss' as vars; | ||
|
||
.button { | ||
align-items: center; | ||
background-color: #62b0ff; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); | ||
color: #fff; | ||
cursor: pointer; | ||
display: flex; | ||
height: 2rem; | ||
justify-content: center; | ||
padding: 4px 1rem; | ||
transition: 0.3s ease-in-out transform; | ||
|
||
width: fit-content; | ||
|
||
&[data-size='default'] { | ||
height: 2.5rem; | ||
} | ||
|
||
&[data-size='small'] { | ||
height: 2rem; | ||
} | ||
|
||
&[data-variant='primary'] { | ||
background-color: #62b0ff; | ||
border: 1px solid #fff; | ||
color: #fff; | ||
|
||
&[data-destructive='true'] { | ||
background-color: #ef626c; | ||
border: 1px solid #fff; | ||
color: #fff; | ||
} | ||
} | ||
|
||
&[data-variant='secondary'] { | ||
background-color: #fff; | ||
border: 1px solid #62b0ff; | ||
color: #62b0ff; | ||
|
||
&[data-destructive='true'] { | ||
background-color: #fff; | ||
border: 1px solid #ef626c; | ||
color: #ef626c; | ||
} | ||
} | ||
|
||
&:hover { | ||
transform: scale(1.04); | ||
|
||
&:disabled { | ||
cursor: wait; | ||
transform: scale(1); | ||
} | ||
} | ||
|
||
&:disabled { | ||
background-color: vars.$disabled !important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export type Styles = { | ||
button: string; | ||
}; | ||
|
||
export type ClassNames = keyof Styles; | ||
|
||
declare const styles: Styles; | ||
|
||
export default styles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { SignInButton, SignInFormItem, SignInTitle } from '@/components/auth'; | ||
import { VerticalForm } from '@/components/common'; | ||
import { config } from '@/lib'; | ||
import withAccessType from '@/lib/hoc/withAccessType'; | ||
import { PermissionService, ValidationService } from '@/lib/services'; | ||
import type { GetServerSideProps, NextPage } from 'next'; | ||
import { SubmitHandler, useForm } from 'react-hook-form'; | ||
import { AiOutlineMail } from 'react-icons/ai'; | ||
import { VscLock } from 'react-icons/vsc'; | ||
|
||
interface FormValues { | ||
email: string; | ||
description: string; | ||
points: number; | ||
} | ||
const AwardPointsPage: NextPage = () => { | ||
const { | ||
register, | ||
handleSubmit, | ||
formState: { errors }, | ||
} = useForm<FormValues>(); | ||
|
||
const onSubmit: SubmitHandler<FormValues> = () => { | ||
// TODO | ||
}; | ||
|
||
return ( | ||
<VerticalForm onEnterPress={handleSubmit(onSubmit)}> | ||
<SignInTitle | ||
text="Retroactive Attendance" | ||
description="Mark members as attended for past events" | ||
/> | ||
<SignInFormItem | ||
icon={<AiOutlineMail />} | ||
element="input" | ||
name="email" | ||
type="email" | ||
placeholder="User Email ([email protected])" | ||
formRegister={register('email', { | ||
validate: email => { | ||
const validation = ValidationService.isValidEmail(email); | ||
return validation.valid || validation.error; | ||
}, | ||
})} | ||
error={errors.email} | ||
/> | ||
<SignInFormItem | ||
icon={<AiOutlineMail />} | ||
element="input" | ||
name="description" | ||
type="text" | ||
placeholder="Description" | ||
formRegister={register('description', { | ||
required: 'Required', | ||
})} | ||
error={errors.description} | ||
/> | ||
<SignInFormItem | ||
icon={<VscLock />} | ||
name="points" | ||
element="input" | ||
type="number" | ||
placeholder="Point Value" | ||
formRegister={register('points', { | ||
required: 'Required', | ||
})} | ||
error={errors.points} | ||
/> | ||
<SignInButton | ||
type="button" | ||
display="button1" | ||
text="Award Points" | ||
onClick={handleSubmit(onSubmit)} | ||
/> | ||
</VerticalForm> | ||
); | ||
}; | ||
|
||
export default AwardPointsPage; | ||
|
||
const getServerSidePropsFunc: GetServerSideProps = async () => ({ | ||
props: {}, | ||
}); | ||
|
||
export const getServerSideProps = withAccessType( | ||
getServerSidePropsFunc, | ||
PermissionService.canAwardPoints, | ||
config.admin.homeRoute | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
26bead4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
membership-portal-ui-v2 – ./
membership-portal-ui-v2-acmucsd.vercel.app
membership-portal-ui-v2.vercel.app
membership-portal-ui-v2-git-main-acmucsd.vercel.app
v2.members.acmucsd.com