Skip to content

Commit

Permalink
feat: use FilePreview display the team's work (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByZack authored Sep 27, 2023
1 parent 2eaf463 commit bd35ed3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
23 changes: 4 additions & 19 deletions components/Team/TeamWorkList.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import { faCalendarDay } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { ScrollList } from 'mobx-restful-table';
import { FilePreview } from 'mobx-restful-table';
import { FC, PureComponent } from 'react';
import {
Button,
Card,
Col,
Container,
Image,
Ratio,
Row,
} from 'react-bootstrap';
import { Button, Card, Col, Container, Row } from 'react-bootstrap';

import activityStore from '../../models/Activity';
import { TeamWork, TeamWorkType } from '../../models/Activity/Team';
import { TeamWork } from '../../models/Activity/Team';
import { i18n } from '../../models/Base/Translation';
import { XScrollListProps } from '../layout/ScrollList';

Expand Down Expand Up @@ -69,15 +62,7 @@ export const TeamWorkListLayout: FC<TeamWorkListLayoutProps> = ({
{description}
</p>
<div className="border-bottom py-2 my-2">
{type === TeamWorkType.IMAGE ? (
<Image src={url} className="mw-100" alt={title} />
) : (
type === TeamWorkType.VIDEO && (
<Ratio aspectRatio="16x9">
<video controls width="250" src={url} />
</Ratio>
)
)}
<FilePreview className="w-100" type={type} path={url} />
</div>
<time
className="d-block p-2 text-truncate"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"mobx-react": "^9.0.1",
"mobx-react-helper": "^0.2.7",
"mobx-restful": "^0.6.11",
"mobx-restful-table": "^1.1.2",
"mobx-restful-table": "^1.1.4",
"next": "^12.3.4",
"next-ssr-middleware": "^0.5.1",
"open-react-map": "^0.6.4",
Expand Down
20 changes: 15 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit bd35ed3

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for open-hackathon ready!

✅ Preview
https://open-hackathon-4op7gf4lj-techquery.vercel.app

Built with commit bd35ed3.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.