Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App update modal background colors #14501

Merged
merged 5 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

*/
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

*/
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
Loading