Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Onboarding #265

Merged
merged 23 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
54a72e2
set up a modal for onboarding
SheepTester Sep 18, 2024
7e2c8aa
Show steps and progress bar
SheepTester Sep 22, 2024
d24040e
Change design of buttons
SheepTester Sep 22, 2024
e0ac0b8
Create onboarding page
SheepTester Sep 22, 2024
327ab82
Add animations for steps 1 and 5
SheepTester Sep 22, 2024
551e9bd
temporary images for intro
SheepTester Sep 22, 2024
f0b2381
add rainbow bar to top of page previews
SheepTester Sep 23, 2024
28274cd
Quiet navbar, perhaps?
SheepTester Sep 23, 2024
282f5e2
address some feedback
SheepTester Sep 28, 2024
89fce1d
Move event list to its own component
SheepTester Sep 29, 2024
ef61648
separate event filter into its own component
SheepTester Sep 29, 2024
58532dd
try annotating badges on event card
SheepTester Sep 29, 2024
60d1df8
Merge branch 'main' into feature/onboarding
SheepTester Sep 29, 2024
667d390
Merge branch 'feature/onboarding' of https://github.com/acmucsd/membe…
SheepTester Sep 28, 2024
b5996de
store collection
SheepTester Sep 29, 2024
2d42ed6
Combine Store and Events components
SheepTester Sep 29, 2024
c2f963e
Make annotations look nicer
SheepTester Sep 29, 2024
529a08f
Leaderboard rows
SheepTester Sep 29, 2024
620d083
start onboarding after checking in
SheepTester Sep 29, 2024
50a8dbb
fix type error
SheepTester Sep 29, 2024
5119178
un-component EventList so the diff is cleaner
SheepTester Sep 29, 2024
177d095
move EventsPageProps back where it used to be
SheepTester Sep 29, 2024
490ef60
Remove periods and exclamation marks from onboarding headings
SheepTester Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/assets/acm-logos/communities/ai.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/assets/acm-logos/communities/cyber.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/assets/acm-logos/communities/design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/assets/acm-logos/communities/hack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/components/common/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Typography from '@/components/common/Typography';
import { PropsWithChildren } from 'react';
import style from './style.module.scss';

Expand All @@ -11,6 +12,11 @@ interface IProps {
className?: string;
}

/**
* Equivalent to
* {@link https://www.figma.com/design/YQjQ1ruLtMICqnzzxBXxOL/ACM-Portal---Onboarding-Screens?node-id=158-1208&t=GsDtnYW4YBMPSN8C-4|"Desktop and mobile buttons"}
* in the Figma
*/
const Button = (props: PropsWithChildren<IProps>) => {
const {
variant = 'primary',
Expand All @@ -20,7 +26,7 @@ const Button = (props: PropsWithChildren<IProps>) => {
size = 'default',
onClick,
children,
className,
className = '',
} = props;

return (
Expand All @@ -33,7 +39,9 @@ const Button = (props: PropsWithChildren<IProps>) => {
data-destructive={destructive}
data-size={size}
>
{children}
<Typography variant="h5/medium" component="span">
{children}
</Typography>
</button>
);
};
Expand Down
31 changes: 8 additions & 23 deletions src/components/common/Button/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

.button {
align-items: center;
background-color: #62b0ff;
background-color: var(--theme-primary-2);
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
color: #fff;
color: var(--theme-background);
cursor: pointer;
display: flex;
height: auto;
justify-content: center;
min-height: 2rem;
padding: 4px 1rem;
transition: 0.3s ease-in-out transform;

padding: 4px 1.5rem;
width: fit-content;

&[data-size='default'] {
Expand All @@ -22,24 +19,20 @@

&[data-size='small'] {
min-height: 2rem;
padding: 4px 1rem;
}

&[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;
background-color: var(--theme-elevated-background);
border: 1px solid var(--theme-elevated-stroke);
color: var(--theme-text-on-background-1);

&[data-destructive='true'] {
background-color: #fff;
Expand All @@ -48,16 +41,8 @@
}
}

&:hover {
transform: scale(1.04);

&:disabled {
cursor: wait;
transform: scale(1);
}
}

&:disabled {
background-color: vars.$disabled !important;
cursor: default;
}
}
22 changes: 19 additions & 3 deletions src/components/common/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ interface DropdownProps {
options: (Option | typeof DIVIDER)[];
value: string;
onChange: (value: string) => void;
readOnly?: boolean;
className?: string;
}

const Dropdown = ({ name, ariaLabel, options, value, onChange, className }: DropdownProps) => {
const Dropdown = ({
name,
ariaLabel,
options,
value,
onChange,
readOnly,
className,
}: DropdownProps) => {
const [open, setOpen] = useState(false);

useEffect(() => {
Expand Down Expand Up @@ -61,8 +70,11 @@ const Dropdown = ({ name, ariaLabel, options, value, onChange, className }: Drop
// mouse/touch users.
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div
className={`${styles.dropdownWrapper} ${className}`}
className={`${styles.dropdownWrapper} ${className} ${readOnly ? styles.readOnly : ''}`}
onClick={e => {
if (readOnly) {
return;
}
// Using the keyboard to select an option fires the click event on
// <select>; prevent it from opening the fake dropdown. The <select> has
// pointer-events: none so it shouldn't receive the click event any
Expand All @@ -82,7 +94,11 @@ const Dropdown = ({ name, ariaLabel, options, value, onChange, className }: Drop
>
{options.map(option =>
option !== DIVIDER ? (
<option value={option.value} key={option.value}>
<option
value={option.value}
key={option.value}
disabled={value !== option.value && readOnly}
>
{option.label}
</option>
) : null
Expand Down
4 changes: 4 additions & 0 deletions src/components/common/Dropdown/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
grid-area: 1 / 2;
position: relative;

&.readOnly {
cursor: unset;
}

select {
appearance: none;
background: none;
Expand Down
1 change: 1 addition & 0 deletions src/components/common/Dropdown/style.module.scss.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export type Styles = {
contents: string;
dropdownWrapper: string;
option: string;
readOnly: string;
};

export type ClassNames = keyof Styles;
Expand Down
16 changes: 14 additions & 2 deletions src/components/common/LinkButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Typography from '@/components/common/Typography';
import type { URL } from '@/lib/types';
import Link from 'next/link';
import { PropsWithChildren } from 'react';
Expand All @@ -8,10 +9,18 @@ interface IProps {
destructive?: boolean;
href: URL;
size?: 'default' | 'small';
onClick?: () => void;
}

const LinkButton = (props: PropsWithChildren<IProps>) => {
const { variant = 'primary', destructive = false, href, size = 'default', children } = props;
const {
variant = 'primary',
destructive = false,
href,
size = 'default',
onClick,
children,
} = props;

return (
<Link
Expand All @@ -20,8 +29,11 @@ const LinkButton = (props: PropsWithChildren<IProps>) => {
data-destructive={destructive}
data-size={size}
href={href}
onClick={onClick}
>
{children}
<Typography variant="h5/medium" component="span">
{children}
</Typography>
</Link>
);
};
Expand Down
32 changes: 9 additions & 23 deletions src/components/common/LinkButton/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

.button {
align-items: center;
background-color: #62b0ff;
background-color: var(--theme-primary-2);
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
color: #fff;
color: var(--theme-background);
cursor: pointer;
display: flex;
height: auto;
justify-content: center;
min-height: 2rem;
padding: 4px 1rem;
transition: 0.3s ease-in-out transform;

padding: 4px 1.5rem;
width: fit-content;

&[data-size='default'] {
Expand All @@ -21,24 +19,20 @@

&[data-size='small'] {
min-height: 2rem;
padding: 4px 1rem;
}

&[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;
background-color: var(--theme-elevated-background);
border: 1px solid var(--theme-elevated-stroke);
color: var(--theme-text-on-background-1);

&[data-destructive='true'] {
background-color: #fff;
Expand All @@ -47,16 +41,8 @@
}
}

&:hover {
transform: scale(1.04);

&:disabled {
cursor: wait;
transform: scale(1);
}
}

&:disabled {
background-color: vars.$disabled !important;
cursor: default;
}
}
Loading