Skip to content

Commit

Permalink
Merge pull request #33 from Bricks666/feature/fix-mobile-ru-layout
Browse files Browse the repository at this point in the history
make gaps and font-size in rooms header adaptive
  • Loading branch information
Bricks666 authored Mar 26, 2024
2 parents 7aa2c19 + f0a4066 commit a8535d3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/pages/rooms/ui/rooms-header/rooms-header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@media (max-width: 600px) {
.title {
font-size: 1.3rem;
}

.bar {
gap: 0.25em;
}
}
5 changes: 5 additions & 0 deletions src/pages/rooms/ui/rooms-header/rooms-header.module.css.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare const styles: {
readonly bar: string;
readonly title: string;
};
export = styles;
9 changes: 7 additions & 2 deletions src/pages/rooms/ui/rooms-header/rooms-header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Typography } from '@mui/material';
import cn from 'classnames';
import * as React from 'react';
import { useTranslation } from 'react-i18next';

Expand All @@ -8,17 +9,21 @@ import { OpenCreateRoom } from '@/features/rooms';

import { CommonProps } from '@/shared/types';

import styles from './rooms-header.module.css';

export const RoomsHeader: React.FC<CommonProps> = (props) => {
const { className, } = props;
const { t, } = useTranslation('rooms');
const title = t('title');

console.log(styles);

return (
<MainHeader
className={className}
className={cn(styles.bar, className)}
slots={{
left: (
<Typography variant='h5' component='h1'>
<Typography className={styles.title} variant='h5' component='h1'>
{title}
</Typography>
),
Expand Down
10 changes: 9 additions & 1 deletion src/shared/ui/template-header/template-header.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.container {
gap: 0.5em;

border-left: none;
border-top: none;
border-right: none;
Expand All @@ -7,7 +9,7 @@
.bar {
display: grid;
grid-template-columns: 150px 1fr 150px;
gap: 0.5em;
gap: inherit;
align-items: center;

padding: 0 1em;
Expand Down Expand Up @@ -50,3 +52,9 @@
grid-column: 2;
}
}

@media (max-width: 600px) {
.bar {
padding: 0 0.5em;
}
}

0 comments on commit a8535d3

Please sign in to comment.