Skip to content

Commit

Permalink
App update modal background colors (#14501)
Browse files Browse the repository at this point in the history
Closes RAUT-928 and RQA-2282
  • Loading branch information
mjhuff authored and TamarZanzouri committed Feb 16, 2024
1 parent 5c3d506 commit e91b15a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
17 changes: 10 additions & 7 deletions app/src/molecules/BackgroundOverlay/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import * as React from 'react'
import { css } from 'styled-components'

import { COLORS, Flex, POSITION_FIXED } from '@opentrons/components'

const BACKGROUND_OVERLAY_STYLE = css`
position: ${POSITION_FIXED};
inset: 0;
z-index: 3;
background-color: ${COLORS.black90}${COLORS.opacity60HexCode};
`

export interface BackgroundOverlayProps
extends React.ComponentProps<typeof Flex> {
// onClick handler so when you click anywhere in the overlay, the modal/menu closes
Expand All @@ -13,13 +22,7 @@ export function BackgroundOverlay(props: BackgroundOverlayProps): JSX.Element {
return (
<Flex
aria-label="BackgroundOverlay"
position={POSITION_FIXED}
left="0"
right="0"
top="0"
bottom="0"
zIndex="3"
backgroundColor={COLORS.grey50}
css={BACKGROUND_OVERLAY_STYLE}
onClick={onClick}
{...flexProps}
/>
Expand Down
4 changes: 0 additions & 4 deletions app/src/molecules/LegacyModal/LegacyModalShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ const Overlay = styled.div`
z-index: 1;
background-color: ${COLORS.black90}${COLORS.opacity40HexCode};
cursor: default;
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
background-color: ${COLORS.grey50};
}
`
const ContentArea = styled.div<{ zIndex: string | number }>`
display: flex;
Expand Down
3 changes: 3 additions & 0 deletions app/src/molecules/LegacyModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface LegacyModalProps extends StyleProps {
footer?: React.ReactNode
}

/**
* For Desktop app use only.
*/
export const LegacyModal = (props: LegacyModalProps): JSX.Element => {
const {
type = 'info',
Expand Down
3 changes: 3 additions & 0 deletions app/src/molecules/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ interface ModalProps extends StyleProps {
/** see ModalHeader component for more details */
header?: ModalHeaderBaseProps
}
/**
* For ODD use only.
*/
export function Modal(props: ModalProps): JSX.Element {
const {
modalSize = 'medium',
Expand Down
9 changes: 3 additions & 6 deletions components/src/modals/ModalShell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import styled from 'styled-components'
import { BORDERS, RESPONSIVENESS, SPACING } from '../ui-style-constants'
import { BORDERS, SPACING } from '../ui-style-constants'
import { COLORS } from '../helix-design-system'
import { StyleProps, styleProps } from '../primitives'
import {
Expand Down Expand Up @@ -78,13 +78,10 @@ const Overlay = styled.div`
top: 0;
bottom: 0;
z-index: 1;
background-color: ${COLORS.black90}${COLORS.opacity40HexCode};
background-color: ${COLORS.black90}${COLORS.opacity60HexCode};
cursor: default;
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
background-color: ${COLORS.grey50};
}
`

const ContentArea = styled.div<{ zIndex: string | number }>`
display: flex;
position: ${POSITION_ABSOLUTE};
Expand Down

0 comments on commit e91b15a

Please sign in to comment.