Skip to content

Commit

Permalink
Merge pull request #458 from BinaryStudioAcademy/task/OV-456-fix-styles
Browse files Browse the repository at this point in the history
OV-456: fix styles
  • Loading branch information
anton-otroshchenko authored Sep 28, 2024
2 parents 4d81666 + c60fa26 commit 3d2e557
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 36 deletions.
5 changes: 1 addition & 4 deletions backend/src/bundles/public-video/public-video.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ class PublicVideoController extends BaseController {
body: { id: string };
}>,
): Promise<ApiHandlerResponse> {
// eslint-disable-next-line no-console
console.log(options.body, 'options.body');
const jwt = options.body.id;
// eslint-disable-next-line no-console
console.log(jwt, 'jwt');

return {
status: HTTPCode.OK,
payload: await this.publicVideoService.findUrlByToken(jwt),
Expand Down
3 changes: 1 addition & 2 deletions backend/src/bundles/videos/video.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class VideoRepository implements Repository {

public async findById(id: string): Promise<VideoEntity | null> {
const video = await this.videoModel.query().findById(id).execute();
// eslint-disable-next-line no-console
console.log(video);

return video ? VideoEntity.initialize(video) : null;
}

Expand Down
2 changes: 1 addition & 1 deletion backend/src/common/constants/white-routes.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const WHITE_ROUTES = [
},
{
path: `/api/v1${ApiPath.PUBLIC_VIDEO}/`,
method: HTTPMethod.GET,
method: HTTPMethod.POST,
},
{
path: /\/v1\/documentation\/.*/,
Expand Down
3 changes: 1 addition & 2 deletions backend/src/common/services/token/token.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class TokenService {

public async getIdFromToken(token: string): Promise<string | null> {
const payload = await this.verifyToken(token);
// eslint-disable-next-line no-console
console.log(payload);

return (payload?.['id'] as string) ?? null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,21 @@ const AvatarCard: React.FC<Properties> = ({
}, [dispatch, id, image]);

return (
<Card size="sm" borderRadius="lg" boxShadow="none" maxW="500px">
<CardBody>
<Box bg="background.50" borderRadius="md" position="relative">
<Image src={image} alt="AI generated avatar image" />
<Card size="sm" borderRadius="lg" boxShadow="none" maxW="250px">
<CardBody position="relative" role="group">
<Flex
bg="background.50"
borderRadius="md"
position="relative"
justifyContent="center"
>
<Image
objectFit="cover"
objectPosition="top"
height="155px"
src={image}
alt="AI generated avatar image"
/>
<IconButton
aria-label="favorite button"
icon={<Icon as={IconName.HEART} boxSize={5} />}
Expand All @@ -54,7 +65,7 @@ const AvatarCard: React.FC<Properties> = ({
right="0"
onClick={handleLike}
/>
</Box>
</Flex>
<Box p="5px 0">
<Text color="typography.900" fontWeight="600">
{name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '~/bundles/common/components/components.js';

import { AvatarCard } from '../components.js';
import styles from './styles.module.css';

type Properties = {
subtitle: string;
Expand Down Expand Up @@ -62,11 +63,7 @@ const AvatarsSection: React.FC<Properties> = ({ subtitle, avatars, form }) => {
Pick your favorites avatars to show them here!
</Text>
) : (
<SimpleGrid
minChildWidth="300px"
justifyItems="center"
spacing="40px"
>
<SimpleGrid className={styles['grid']} spacing="40px">
{avatars.map(({ id, imgUrl, name, style, isLiked }) => (
<AvatarCard
key={`${id}-${style}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.grid {
grid-template-columns: repeat(auto-fit, 250px);
}
2 changes: 1 addition & 1 deletion frontend/src/bundles/chat/pages/chat-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ChatModal: React.FC<Properties> = ({
<Chat
messages={messages}
onSendMessage={handleSendMessage}
headerTitle="GPT4 Script Writer"
headerTitle="AI Assistant"
headerComment="Your secret to crafting compelling scripts effortlessly!"
/>
</ModalContent>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/bundles/common/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Header: React.FC<Properties> = ({ left, center, right }) => {
</Box>
)}
<Box className={styles['center']}>{center}</Box>
{right && <Box className={styles['right']}>{right}</Box>};
{right && <Box className={styles['right']}>{right}</Box>}
</Flex>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const GenerateScriptView: React.FC<Properties> = ({ onClose }) => {
return (
<>
<Heading className={styles['script-view-heading']} variant="H3">
Use Open AI to draft your video script
Use our AI Assistant to draft your video script
</Heading>
<Tabs variant="unstyled" size="sm">
<TabList className={styles['script-view-tab-list']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Consent: React.FC = () => {
return (
<Flex className={styles['flex-container']}>
<Text variant={'title'} color={'background.600'} marginTop={'2vh'}>
Concent
Consent
</Text>
<Text variant={'body1'} color="typography.600" mb={3}>
To prevent misuse of technology, we just need to confirm the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const VideoCard: React.FC<Properties> = ({
}, [dispatch, id]);

return (
<Box borderRadius="8px" bg="white" padding="7px">
<Box borderRadius="8px" maxWidth={'250px'} bg="white" padding="7px">
<Box
position="relative"
role="group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
scrollbar-width: thin;
scrollbar-color: #c1c1c1 #f1f1f1;
}

.grid {
grid-template-columns: repeat(auto-fit, 250px);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ const VideoSection: React.FC<Properties> = ({ videos, title }) => {
))}
</Box>
) : (
<SimpleGrid
columns={{ sm: 2, md: 3, lg: 4 }}
spacing="20px"
>
<SimpleGrid spacing="20px" className={styles['grid']}>
{videos.map(({ id, ...video }) => (
<VideoCard key={id} id={id} {...video} />
))}
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/bundles/preview/components/preview-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Preview } from '~/bundles/preview/pages/preview.js';

const PreviewWrapper: React.FC = () => {
const { jwt } = useParams<{ jwt: string }>();
// eslint-disable-next-line no-console
console.log('PreviewWrapper', jwt);

return <Preview jwt={jwt ?? ''} />;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const TemplateCard: React.FC<Properties> = ({ id, name, previewUrl }) => {
}, [handleWarningModalClose]);

return (
<Box borderRadius="8px" bg="white" padding="7px">
<Box borderRadius="8px" bg="white" maxWidth="250px" padding="7px">
<Box
position="relative"
role="group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
background-color: white;
color: #4a4a4a;
}

.grid {
grid-template-columns: repeat(auto-fit, 250px);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { type Template } from '~/bundles/template/types/types.js';

import { TemplateCard } from '../template-card/template-card.js';
import { DEFAULT_TEMPLATE_PAYLOAD } from './constants.js';
import styles from './styles.module.css';

type Properties = {
templates: Template[];
Expand Down Expand Up @@ -113,7 +114,11 @@ const TemplatesSection: React.FC<Properties> = ({ templates }) => {
</FormProvider>
</Flex>
</Flex>
<SimpleGrid columns={{ sm: 2, md: 3, lg: 4 }} spacing="20px">
<SimpleGrid
minChildWidth="200px"
spacing="20px"
className={styles['grid']}
>
{templates.map(({ id, ...template }) => (
<TemplateCard key={id} {...template} id={id} />
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
scrollbar-width: thin;
scrollbar-color: #c1c1c1 #f1f1f1;
}

.grid {
grid-template-columns: repeat(auto-fit, 250px);
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ const VoiceSection: React.FC<Properties> = ({ voices, title }) => {
))}
</Box>
) : (
<SimpleGrid
columns={{ sm: 2, md: 3, lg: 4 }}
spacing="20px"
>
<SimpleGrid className={styles['grid']} spacing="20px">
{voices.map((voice) => (
<VoiceCard voice={voice} key={voice.shortName} />
))}
Expand Down

0 comments on commit 3d2e557

Please sign in to comment.