Skip to content

Commit

Permalink
idt2 embeds ux styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HarveyPeachey committed Jul 28, 2023
1 parent 0c77197 commit 0f45a71
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
19 changes: 16 additions & 3 deletions src/app/components/Embeds/EmbedHtml/index.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { css, Theme } from '@emotion/react';

const styles = {
embedDiv: ({ spacings }: Theme) =>
embedDiv: ({ spacings, mq }: Theme) =>
css({
maxWidth: '100%',
overflow: 'scroll hidden',
marginBottom: spacings.QUINTUPLE,
paddingLeft: `${spacings.FULL}rem`,
paddingRight: `${spacings.FULL}rem`,
paddingBottom: `${spacings.DOUBLE}rem`,

[mq.GROUP_1_MIN_WIDTH]: {
paddingBottom: `${spacings.TRIPLE}rem`,
},
[mq.GROUP_2_MIN_WIDTH]: {
paddingLeft: `${spacings.DOUBLE}rem`,
paddingRight: `${spacings.DOUBLE}rem`,
},
[mq.GROUP_4_MIN_WIDTH]: {
paddingLeft: '0',
paddingRight: '0',
},
}),
};

Expand Down
24 changes: 24 additions & 0 deletions src/app/components/Embeds/EmbedImages/index.styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { css, Theme } from '@emotion/react';

const styles = {
embedDiv: ({ spacings, mq }: Theme) =>
css({
paddingLeft: `${spacings.FULL}rem`,
paddingRight: `${spacings.FULL}rem`,
paddingBottom: `${spacings.DOUBLE}rem`,

[mq.GROUP_1_MIN_WIDTH]: {
paddingBottom: `${spacings.TRIPLE}rem`,
},
[mq.GROUP_2_MIN_WIDTH]: {
paddingLeft: `${spacings.DOUBLE}rem`,
paddingRight: `${spacings.DOUBLE}rem`,
},
[mq.GROUP_4_MIN_WIDTH]: {
paddingLeft: '0',
paddingRight: '0',
},
}),
};

export default styles;
7 changes: 6 additions & 1 deletion src/app/components/Embeds/EmbedImages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { jsx } from '@emotion/react';
import { PropsWithChildren, useContext } from 'react';
import { RequestContext } from '#app/contexts/RequestContext';
import styles from './index.styles';
import Image from '../../Image';

type Props = {
Expand All @@ -27,7 +28,11 @@ const EmbedImages = ({ blocks: embedImages }: PropsWithChildren<Props>) => {

if (!locator || !alt || !width || !height) return null;

return <Image src={src} alt={alt} width={width} height={height} />;
return (
<div css={styles.embedDiv}>
<Image src={src} alt={alt} width={width} height={height} />
</div>
);
};

export default EmbedImages;

0 comments on commit 0f45a71

Please sign in to comment.