mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-17 17:40:16 -04:00
show carpool note + improve uix
This commit is contained in:
parent
a01f44e8a6
commit
8739d84b7b
|
@ -195,7 +195,11 @@ export default function Carpool({ id }: { id: number }) {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<UISecondaryBox
|
<UISecondaryBox
|
||||||
style={{ width: '45rem', maxWidth: '100vw', alignItems: 'center' }}
|
style={{
|
||||||
|
width: '45rem',
|
||||||
|
maxWidth: 'min(45rem, 100vw)',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<h1>{carpool.name}</h1>
|
<h1>{carpool.name}</h1>
|
||||||
{isCreator
|
{isCreator
|
||||||
|
|
|
@ -19,7 +19,7 @@ export default function CarpoolDetails() {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div style={{ width: '80%' }}>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
color: '#303030',
|
color: '#303030',
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
|
import CancelIcon from '@material-ui/icons/Clear';
|
||||||
|
import DoneIcon from '@material-ui/icons/Done';
|
||||||
|
import EditIcon from '@material-ui/icons/Edit';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
import UIPressable from '../UI/UIPressable';
|
|
||||||
import UITextInput from '../UI/UITextInput';
|
import UITextInput from '../UI/UITextInput';
|
||||||
import useIsCreator from './useIsCreator';
|
import useIsCreator from './useIsCreator';
|
||||||
import EditIcon from '@material-ui/icons/Edit';
|
|
||||||
import DoneIcon from '@material-ui/icons/Done';
|
|
||||||
import CancelIcon from '@material-ui/icons/Clear';
|
|
||||||
|
|
||||||
export default function CarpoolNote({
|
export default function CarpoolNote({
|
||||||
note,
|
note,
|
||||||
|
@ -32,7 +31,7 @@ export default function CarpoolNote({
|
||||||
}, [editText, setNote]);
|
}, [editText, setNote]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ marginTop: '0.5rem', padding: '1rem' }}>
|
<div style={{ margin: '1rem 0rem', maxWidth: '100%' }}>
|
||||||
<b>Note</b>
|
<b>Note</b>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -41,7 +41,6 @@ export default function MemberList() {
|
||||||
[carpool]
|
[carpool]
|
||||||
);
|
);
|
||||||
const members = useSignups(carpool.event.id, memberIDs);
|
const members = useSignups(carpool.event.id, memberIDs);
|
||||||
console.log(members);
|
|
||||||
|
|
||||||
const membersToShow = useMemo(
|
const membersToShow = useMemo(
|
||||||
() => (expanded ? members : members.slice(0, shownMembersCount)),
|
() => (expanded ? members : members.slice(0, shownMembersCount)),
|
||||||
|
|
|
@ -29,6 +29,7 @@ export default function EventCarpoolCreateButton() {
|
||||||
try {
|
try {
|
||||||
event.carpools.push({
|
event.carpools.push({
|
||||||
id,
|
id,
|
||||||
|
note: '',
|
||||||
name: me.name + "'s Carpool",
|
name: me.name + "'s Carpool",
|
||||||
members: [{ id: me.id, name: me.name }],
|
members: [{ id: me.id, name: me.name }],
|
||||||
});
|
});
|
||||||
|
|
|
@ -91,7 +91,6 @@ function CarpoolRow({
|
||||||
marginBottom: '0.5rem',
|
marginBottom: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* <div> */}
|
|
||||||
<span
|
<span
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -100,9 +99,8 @@ function CarpoolRow({
|
||||||
>
|
>
|
||||||
<b>{carpool.name}</b>
|
<b>{carpool.name}</b>
|
||||||
{extraDistance !== null && ' +' + extraDistance.toFixed(1) + ' miles'}
|
{extraDistance !== null && ' +' + extraDistance.toFixed(1) + ' miles'}
|
||||||
|
{carpool.note && ' - ' + carpool.note}
|
||||||
</span>
|
</span>
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
{!inCarpoolAlready && (
|
{!inCarpoolAlready && (
|
||||||
<>
|
<>
|
||||||
{inviteState === 'none' ? (
|
{inviteState === 'none' ? (
|
||||||
|
@ -116,7 +114,7 @@ function CarpoolRow({
|
||||||
onClick={cancelButton}
|
onClick={cancelButton}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
// inviteState === 'invited
|
// inviteState === invited
|
||||||
<CheckIcon style={{ fontSize: '2em', cursor: 'pointer' }} />
|
<CheckIcon style={{ fontSize: '2em', cursor: 'pointer' }} />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -76,6 +76,7 @@ export type IEvent = {
|
||||||
carpools: {
|
carpools: {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
note: string;
|
||||||
members: {
|
members: {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user