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

Make meetings wider, higher and add description #291

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 16 additions & 13 deletions src/components/myMeetings/Meeting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface ParticipantResult {
export interface MeetingProps {
id: string;
title: string;
description?: string | null;
description: string | undefined;
startTime: string;
organization: string;
participants: ParticipantResult[];
Expand All @@ -30,14 +30,14 @@ const styles = {
width: '100%',
borderRadius: '4px',
boxShadow,
padding: '1em 2em',
padding: '2em',
overflow: 'hidden',
...transition,
} as React.CSSProperties;

const Meeting: React.FC<
MeetingProps & { handleDeleteMeeting: (id: string) => void; meetingStatus: 'open' | 'upcoming' | 'ended' }
> = ({ id, title, startTime, participants, handleDeleteMeeting, meetingStatus }) => {
> = ({ id, title, startTime, participants, handleDeleteMeeting, meetingStatus, description }) => {
const { user } = useAuth0();
const history = useHistory();
const [isAdmin, setIsAdmin] = useState(false);
Expand Down Expand Up @@ -94,17 +94,20 @@ const Meeting: React.FC<
<Heading as="h2" fontSize="1.5em">
{title}
</Heading>
<Text fontSize="1em">{formatMeetingTime(new Date(startTime))}</Text>
<Box minH="2rem">{description && <Text>{description}</Text>}</Box>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will show an empty div with 2rem even if description is missing. Is this intended? or should it be:

{description && <Box minH="2rem"><Text>{description}</Text></Box>}

</VStack>
{isAdmin ? (
<MeetingActionsWithPopover
meetingStatus={meetingStatus}
onEditClick={() => history.push(`/meeting/${id}/edit`)}
onDeleteClick={() => setDialogIsOpen(true)}
/>
) : (
<Box h="1rem" />
)}
<HStack w="100%" justifyContent="space-between">
<Text fontSize="1em">{formatMeetingTime(new Date(startTime))}</Text>
{isAdmin ? (
<MeetingActionsWithPopover
meetingStatus={meetingStatus}
onEditClick={() => history.push(`/meeting/${id}/edit`)}
onDeleteClick={() => setDialogIsOpen(true)}
/>
) : (
<Box h="1rem" />
)}
</HStack>
<CustomAlertDialog
dialogIsOpen={dialogIsOpen}
handleConfirm={() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/myMeetings/MeetingActionsWithPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const MeetingActionsWithPopover: React.FC<MeetingActionsWithPopoverProps> = ({
}) => {
const [isOpen, setIsOpen] = useState(false);
return (
<HStack justifyContent="end" w="100%">
<HStack>
<Popover placement="top-end" isOpen={isOpen} onClose={() => setIsOpen(false)}>
<PopoverTrigger>
<Button
Expand Down
7 changes: 1 addition & 6 deletions src/pages/MyMeetings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,12 @@ const MyMeetings: React.FC = () => {
return (
<PageContainer>
{deleteMeetingLoading && <Loading asOverlay text="Sletter møte" />}
<Box m="auto" pt="5em" pb="1.125em" maxWidth="600px">
<Box m="auto" pt="5em" pb="1.125em" maxWidth="800px">
{meetingsData.length === 0 && (
<Center m="0 2em 2.625em">
<Text>Du har ingen kommende møter</Text>
</Center>
)}
{(ongoingMeetings.length > 0 || upcomingMeetings.length > 0) && (
<Heading as="h1" fontSize="1em" mx="2em" mb="1.125em">
Mine møter
</Heading>
)}
{ongoingMeetings.length > 0 && (
<Box m="0 2em 1.5em">
<MeetingList
Expand Down