0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

fix(console): set preview desktop background color (#1292)

This commit is contained in:
Wang Sijie 2022-07-01 18:56:41 +08:00 committed by GitHub
parent d456f5c9a2
commit a1726d58b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
import { Language } from '@logto/phrases'; import { Language } from '@logto/phrases';
import { AppearanceMode, ConnectorDTO, ConnectorMetadata, SignInExperience } from '@logto/schemas'; import { AppearanceMode, ConnectorDTO, ConnectorMetadata, SignInExperience } from '@logto/schemas';
import { conditional } from '@silverhand/essentials';
import classNames from 'classnames'; import classNames from 'classnames';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import React, { useEffect, useMemo, useState, useRef, useCallback } from 'react'; import React, { useEffect, useMemo, useState, useRef, useCallback } from 'react';
@ -176,6 +177,12 @@ const Preview = ({ signInExperience, className }: Props) => {
</TabNav> </TabNav>
<div <div
className={classNames(styles.body, platform === 'desktopWeb' ? styles.web : styles.mobile)} className={classNames(styles.body, platform === 'desktopWeb' ? styles.web : styles.mobile)}
style={conditional(
platform === 'desktopWeb' && {
// Set background color to match iframe's background color on both dark and light mode.
backgroundColor: mode === AppearanceMode.DarkMode ? '#2A2C31' : '#e5e1ec',
}
)}
> >
<div className={styles.deviceWrapper}> <div className={styles.deviceWrapper}>
<div className={classNames(styles.device, styles[mode])}> <div className={classNames(styles.device, styles[mode])}>