mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 11:20:17 -04:00
add captions to act as ui helpers
This commit is contained in:
parent
87a49190eb
commit
510ce220c9
|
@ -55,7 +55,7 @@ export default function EventCarpoolCreateButton() {
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span>Available to drive?</span>
|
<span style={{ fontSize: '0.875em' }}>Available to drive?</span>
|
||||||
<UIButton
|
<UIButton
|
||||||
onClick={createCarpoolCallback}
|
onClick={createCarpoolCallback}
|
||||||
style={{ backgroundColor: lightgrey }}
|
style={{ backgroundColor: lightgrey }}
|
||||||
|
|
|
@ -141,6 +141,10 @@ export default function Carpools() {
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<h3 style={{ marginBottom: '0' }}>Carpools</h3>
|
<h3 style={{ marginBottom: '0' }}>Carpools</h3>
|
||||||
|
<span style={{ fontSize: '0.875rem' }}>
|
||||||
|
Click <EmojiPeopleIcon style={{ fontSize: '0.875rem' }} /> to request to
|
||||||
|
join a carpool.
|
||||||
|
</span>
|
||||||
{event.carpools.map((carpool) => (
|
{event.carpools.map((carpool) => (
|
||||||
<CarpoolRow
|
<CarpoolRow
|
||||||
carpool={carpool}
|
carpool={carpool}
|
||||||
|
|
|
@ -65,6 +65,7 @@ export default function EventInterestForm() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<span style={{ fontSize: '0.875em' }}>Click to toggle your interest</span>
|
||||||
<UIButton
|
<UIButton
|
||||||
onClick={
|
onClick={
|
||||||
interested
|
interested
|
||||||
|
@ -84,6 +85,9 @@ export default function EventInterestForm() {
|
||||||
</UIButton>
|
</UIButton>
|
||||||
{interested && (
|
{interested && (
|
||||||
<>
|
<>
|
||||||
|
<span style={{ fontSize: '0.875em' }}>
|
||||||
|
Click to toggle your driving availability
|
||||||
|
</span>
|
||||||
<UIButton
|
<UIButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
canDriveRef.current = !canDriveRef.current;
|
canDriveRef.current = !canDriveRef.current;
|
||||||
|
|
|
@ -83,6 +83,7 @@ export default function EventSignups() {
|
||||||
const { event } = useContext(EventContext);
|
const { event } = useContext(EventContext);
|
||||||
const signups = event.signups;
|
const signups = event.signups;
|
||||||
const carpools = event.carpools;
|
const carpools = event.carpools;
|
||||||
|
const me = useMe();
|
||||||
|
|
||||||
const signupsWithoutCarpool = useMemo(() => {
|
const signupsWithoutCarpool = useMemo(() => {
|
||||||
// A list of users not in any carpool
|
// A list of users not in any carpool
|
||||||
|
@ -94,10 +95,24 @@ export default function EventSignups() {
|
||||||
.map((id) => signups[id]);
|
.map((id) => signups[id]);
|
||||||
}, [signups, carpools]);
|
}, [signups, carpools]);
|
||||||
|
|
||||||
|
const hasCarpool = useMemo(
|
||||||
|
() =>
|
||||||
|
event.carpools.some((carpool) =>
|
||||||
|
carpool.members.some((member) => member.id === me?.id)
|
||||||
|
),
|
||||||
|
[event.carpools, me?.id]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<h3 style={{ marginBlockEnd: '0' }}>People without a carpool</h3>
|
<h3 style={{ marginBlockEnd: '0' }}>People without a carpool</h3>
|
||||||
<EventCarpoolCreateButton />
|
<EventCarpoolCreateButton />
|
||||||
|
{!hasCarpool && (
|
||||||
|
<span style={{ fontSize: '0.875em' }}>
|
||||||
|
Click <PersonAddIcon style={{ fontSize: '0.875rem' }} /> to add
|
||||||
|
someone to the temporary invite list
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
{signupsWithoutCarpool.map((signup) => (
|
{signupsWithoutCarpool.map((signup) => (
|
||||||
<EventSignup key={signup.user.id} signup={signup} />
|
<EventSignup key={signup.user.id} signup={signup} />
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -1,30 +1,39 @@
|
||||||
import { IGroup } from '../types';
|
import { IGroup } from '../types';
|
||||||
|
import UILink from '../UI/UILink';
|
||||||
import UISecondaryBox from '../UI/UISecondaryBox';
|
import UISecondaryBox from '../UI/UISecondaryBox';
|
||||||
|
|
||||||
function GroupListItem({ group }: { group: IGroup }) {
|
function GroupListItem({ group }: { group: IGroup }) {
|
||||||
return (
|
return (
|
||||||
<UISecondaryBox>
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
<h2
|
<span
|
||||||
style={{
|
style={{
|
||||||
textAlign: 'center',
|
fontSize: '1.5rem',
|
||||||
cursor: 'pointer',
|
fontWeight: 'bold',
|
||||||
}}
|
display: 'block',
|
||||||
onClick={() => {
|
marginTop: '1rem',
|
||||||
window.location.href = `/groups/${group.id}`;
|
marginBottom: '1rem',
|
||||||
|
marginRight: '2rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{group.name}
|
{group.name}
|
||||||
</h2>
|
</span>
|
||||||
</UISecondaryBox>
|
<UILink href={`/groups/${group.id}`}>View group</UILink>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function GroupList({ groups }: { groups: IGroup[] }) {
|
export default function GroupList({ groups }: { groups: IGroup[] }) {
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
|
<UISecondaryBox
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
boxSizing: 'border-box',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
{groups.map((group) => (
|
{groups.map((group) => (
|
||||||
<GroupListItem group={group} key={group.id} />
|
<GroupListItem group={group} key={group.id} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</UISecondaryBox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,8 @@ const baseStyle: CSSProperties = {
|
||||||
borderRadius: '0.5em',
|
borderRadius: '0.5em',
|
||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
margin: '0.5em',
|
marginTop: '0.5rem',
|
||||||
|
marginBottom: '0.5rem',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user