mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 19:29:51 -04:00
update availability selector
This commit is contained in:
parent
d3805dcaa1
commit
f24f7b6572
|
@ -1,5 +1,10 @@
|
||||||
import { CSSProperties } from '@material-ui/styles';
|
import { CSSProperties } from '@material-ui/styles';
|
||||||
import { MouseEventHandler, useCallback, useState } from 'react';
|
import {
|
||||||
|
MouseEventHandler,
|
||||||
|
ReactEventHandler,
|
||||||
|
useCallback,
|
||||||
|
useState,
|
||||||
|
} from 'react';
|
||||||
|
|
||||||
export type AvailabilityKind = 'going' | 'interested' | 'not-interested';
|
export type AvailabilityKind = 'going' | 'interested' | 'not-interested';
|
||||||
|
|
||||||
|
@ -54,7 +59,8 @@ function Option({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Availability({
|
// eslint-disable-next-line
|
||||||
|
function Availability__old({
|
||||||
selected,
|
selected,
|
||||||
onSelected: onSelectedInner,
|
onSelected: onSelectedInner,
|
||||||
}: {
|
}: {
|
||||||
|
@ -106,3 +112,40 @@ export default function Availability({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function Availability({
|
||||||
|
selected,
|
||||||
|
onSelected: onSelectedInner,
|
||||||
|
}: {
|
||||||
|
selected: AvailabilityKind;
|
||||||
|
onSelected: (kind: AvailabilityKind) => void;
|
||||||
|
}) {
|
||||||
|
const onSelected: ReactEventHandler<HTMLSelectElement> = useCallback(
|
||||||
|
(event) => {
|
||||||
|
onSelectedInner(
|
||||||
|
// @ts-ignore
|
||||||
|
event.target.value
|
||||||
|
);
|
||||||
|
event.preventDefault();
|
||||||
|
},
|
||||||
|
[onSelectedInner]
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<select
|
||||||
|
value={selected}
|
||||||
|
onChange={onSelected}
|
||||||
|
style={{
|
||||||
|
fontFamily: 'Inter',
|
||||||
|
fontSize: '1rem',
|
||||||
|
border: '0px solid black',
|
||||||
|
borderRadius: '0.5rem',
|
||||||
|
padding: '0.5rem',
|
||||||
|
marginTop: '1rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<option value="going">Going</option>
|
||||||
|
<option value="interested">Interested</option>
|
||||||
|
<option value="not-interested">Not interested</option>
|
||||||
|
</select>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -46,8 +46,6 @@ export default function Group() {
|
||||||
|
|
||||||
const { name } = group;
|
const { name } = group;
|
||||||
|
|
||||||
console.log({ events });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user