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(#vil-501): mes videos et alignement #961

Merged
merged 1 commit into from
Jul 9, 2024
Merged
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
16 changes: 13 additions & 3 deletions src/components/activities/ActivitySelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import { Button, CircularProgress } from '@mui/material';
import { Box, Button, CircularProgress } from '@mui/material';

import { Activities } from './List';
import { ThemeChoiceButton } from 'src/components/buttons/ThemeChoiceButton';
Expand Down Expand Up @@ -98,7 +98,17 @@ export const ActivitySelect = ({ value, onChange, onSelect, style, label = 'Sél
</div>
</div>
) : (
<div style={{ minHeight: '50px', overflow: 'auto', overflowX: 'hidden' }}>
<Box
sx={{
minHeight: '50px',
overflow: 'auto',
overflowX: 'hidden',
paddingLeft: {
xs: activities.length === 0 ? '1.4rem' : '0',
sm: '0px',
},
}}
>
<Activities
activities={activities}
noButtons
Expand All @@ -119,7 +129,7 @@ export const ActivitySelect = ({ value, onChange, onSelect, style, label = 'Sél
</div>
)
)}
</div>
</Box>
)
}
/>
Expand Down
39 changes: 28 additions & 11 deletions src/pages/mes-videos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Tooltip from '@mui/material/Tooltip';

import { Base } from 'src/components/Base';
import { Modal } from 'src/components/Modal';
import { PageLayout } from 'src/components/PageLayout';
import { VideoView } from 'src/components/activities/content/views/VideoView';
import { DeleteButton } from 'src/components/buttons/DeleteButton';
import { useVideos } from 'src/services/useVideos';
Expand Down Expand Up @@ -43,19 +44,30 @@ const MesVideos = () => {
}
};

const cellStyles = {
padding: '5px',
margin: 0,
};

return (
<Base>
<div style={{ width: '100%', padding: '0.5rem 1rem 1rem 1rem' }}>
<div className="width-900">
<PageLayout>
<div className="width-900" style={{ overflow: 'auto' }}>
<h1>{'Mes vidéos'}</h1>
{videos.length > 0 ? (
<Table size="medium" style={{ marginTop: '1rem' }}>
<TableHead style={{ borderBottom: '1px solid white' }}>
<TableRow>
<TableCell style={{ fontWeight: 'bold' }}>#</TableCell>
<TableCell style={{ fontWeight: 'bold' }}>Nom de la vidéo</TableCell>
<TableCell style={{ fontWeight: 'bold' }}>Lien de la vidéo (URL)</TableCell>
<TableCell style={{ fontWeight: 'bold' }} align="right">
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })} style={{ fontWeight: 'bold' }}>
#
</TableCell>
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })} style={{ fontWeight: 'bold' }}>
Nom de la vidéo
</TableCell>
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })} style={{ fontWeight: 'bold' }}>
Lien de la vidéo (URL)
</TableCell>
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })} style={{ fontWeight: 'bold' }} align="right">
Actions
</TableCell>
</TableRow>
Expand All @@ -74,10 +86,15 @@ const MesVideos = () => {
},
}}
>
<TableCell>{index + 1}</TableCell>
<TableCell>{video.name}</TableCell>
<TableCell>https://player.vimeo.com/video/{video.id}</TableCell>
<TableCell align="right" padding="none" style={{ minWidth: '96px' }}>
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })}>{index + 1}</TableCell>
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })}>{video.name}</TableCell>
<TableCell sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })}>https://player.vimeo.com/video/{video.id}</TableCell>
<TableCell
sx={(theme) => ({ [theme.breakpoints.only('xs')]: cellStyles })}
align="right"
padding="none"
style={{ minWidth: '96px' }}
>
<Tooltip title="Regarder">
<IconButton
aria-label="Voir"
Expand Down Expand Up @@ -123,7 +140,7 @@ const MesVideos = () => {
{selectedVideo !== null && <VideoView id={selectedVideo.id} value={`https://player.vimeo.com/video/${selectedVideo.id}`}></VideoView>}
</div>
</Modal>
</div>
</PageLayout>
</Base>
);
};
Expand Down
Loading