Skip to content

Commit

Permalink
fixed design for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsNyl committed Nov 18, 2023
1 parent a8a3a30 commit e9a0c78
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/miscellaneous/reactions/EmojiItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export const EmojiItem = ({ data, emoji, content_type }: EmojiItemProps) => {
return (
<Button onClick={() => handleDelete(userReaction.reaction_id)} variant='outlined'>
<Stack direction='row' spacing={0.5}>
<Typography>{emoji.emoji}</Typography>
<Typography fontSize={12}>{emoji.count}</Typography>
<Typography sx={{ fontSize: { xs: 14, md: 16 } }}>{emoji.emoji}</Typography>
<Typography sx={{ fontSize: { xs: 10, md: 12 } }}>{emoji.count}</Typography>
</Stack>
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const EmojiPickerHandler = ({ data, content_type }: ReactionHandlerProps)
return (
<Container>
<Button onClick={openPopover} variant='outlined'>
<AddReactionOutlinedIcon />
<AddReactionOutlinedIcon fontSize='small' />
</Button>

<MuiDialog onClose={closePopover} open={open}>
Expand Down
3 changes: 1 addition & 2 deletions src/components/miscellaneous/reactions/EmojiShowAll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const EmojiShowAll = ({ data, content_type }: ReactionHandlerProps) => {
const closeDialog = () => setOpen(false);

const emojiCollections: Record<string, number> = {};

data?.reactions?.forEach((r) => {
emojiCollections[r.emoji] = (emojiCollections[r.emoji] || 0) + 1;
});
Expand All @@ -29,7 +28,7 @@ export const EmojiShowAll = ({ data, content_type }: ReactionHandlerProps) => {
return (
<Container>
<Button onClick={openDialog} variant='outlined'>
<ArrowOutwardIcon />
<ArrowOutwardIcon fontSize='small' />
</Button>

<Dialog onClose={closeDialog} open={open} titleText={`Alle reaksjoner (${data.reactions?.length})`}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/miscellaneous/reactions/EmojiShowcase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Stack } from '@mui/material';
import { EmojiItem } from './EmojiItem';
import { ReactionHandlerProps } from './ReactionHandler';

export const EmojiShowcase = ({ data }: ReactionHandlerProps) => {
export const EmojiShowcase = ({ data, content_type }: ReactionHandlerProps) => {
const emojiCollections: Record<string, number> = {};

data?.reactions?.forEach((r) => {
Expand All @@ -18,7 +18,7 @@ export const EmojiShowcase = ({ data }: ReactionHandlerProps) => {
return (
<Stack direction='row' spacing={1}>
{topEmojiCollections.map((emoji, index) => (
<EmojiItem data={data} emoji={emoji} key={index} />
<EmojiItem content_type={content_type} data={data} emoji={emoji} key={index} />
))}
</Stack>
);
Expand Down
3 changes: 1 addition & 2 deletions src/pages/NewsDetails/components/NewsRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const NewsRenderer = ({ data, preview = false }: NewsRendererProps) => {
</Button>
</HavePermission>
)}
<Stack alignItems='center' direction='row' justifyContent='space-between'>
<Stack alignItems='center' justifyContent='space-between' sx={{ flexDirection: { xs: 'column', md: 'row' }, gap: { xs: '12px', md: '0px' } }}>
<Stack alignItems='center' direction='row' justifyContent='space-between'>
<Typography variant='body2'>
Publisert: {formatDate(parseISO(data.created_at), { time: false })}
Expand All @@ -75,7 +75,6 @@ const NewsRenderer = ({ data, preview = false }: NewsRendererProps) => {
)}
</Typography>
</Stack>

{data?.emojis_allowed && <ReactionHandler content_type='news' data={data} />}
</Stack>
<Paper>
Expand Down

0 comments on commit e9a0c78

Please sign in to comment.