|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
import React, { useMemo } from 'react';
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
|
|
|
|
|
import { defaultSettings } from 'soapbox/actions/settings';
|
|
|
|
|
import BackgroundShapes from 'soapbox/features/ui/components/background_shapes';
|
|
|
|
|
import { normalizeSoapboxConfig } from 'soapbox/normalizers';
|
|
|
|
|
import { generateThemeCss } from 'soapbox/utils/theme';
|
|
|
|
|
|
|
|
|
@ -15,33 +17,33 @@ const SitePreview: React.FC<ISitePreview> = ({ soapbox }) => {
|
|
|
|
|
const soapboxConfig = useMemo(() => normalizeSoapboxConfig(soapbox), [soapbox]);
|
|
|
|
|
const settings = defaultSettings.mergeDeep(soapboxConfig.defaultSettings);
|
|
|
|
|
|
|
|
|
|
const bodyClass = classNames('site-preview', `theme-mode-${settings.get('themeMode')}`, {
|
|
|
|
|
'no-reduce-motion': !settings.get('reduceMotion'),
|
|
|
|
|
'underline-links': settings.get('underlineLinks'),
|
|
|
|
|
'dyslexic': settings.get('dyslexicFont'),
|
|
|
|
|
'demetricator': settings.get('demetricator'),
|
|
|
|
|
});
|
|
|
|
|
const dark = settings.get('themeMode') === 'dark';
|
|
|
|
|
|
|
|
|
|
const bodyClass = classNames(
|
|
|
|
|
'site-preview',
|
|
|
|
|
'relative flex justify-center align-center text-base',
|
|
|
|
|
'border border-solid border-gray-200 dark:border-slate-600',
|
|
|
|
|
'h-40 rounded-lg overflow-hidden',
|
|
|
|
|
{
|
|
|
|
|
'bg-white': !dark,
|
|
|
|
|
'bg-slate-900': dark,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={bodyClass}>
|
|
|
|
|
<style>{`.site-preview {${generateThemeCss(soapboxConfig)}}`}</style>
|
|
|
|
|
<div className='app-holder'>
|
|
|
|
|
<div>
|
|
|
|
|
<div className='ui'>
|
|
|
|
|
<nav className='tabs-bar'>
|
|
|
|
|
<div className='tabs-bar__container'>
|
|
|
|
|
<div className='tabs-bar__split tabs-bar__split--left'>
|
|
|
|
|
<a className='tabs-bar__link--logo' href='#'>
|
|
|
|
|
<img alt='Logo' src={soapboxConfig.logo} />
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
<div className='page'>
|
|
|
|
|
<span className='spoiler-button__overlay__label'>Site Preview</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<BackgroundShapes position='absolute' />
|
|
|
|
|
|
|
|
|
|
<div className='absolute p-2 rounded-lg overflow-hidden bg-accent-500 text-white self-center z-20'>
|
|
|
|
|
<FormattedMessage id='site_preview.preview' defaultMessage='Preview' />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className={classNames('flex absolute inset-0 shadow z-10 h-12 lg:h-16', {
|
|
|
|
|
'bg-white': !dark,
|
|
|
|
|
'bg-slate-800': dark,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
<img alt='Logo' className='h-5 lg:h-6 self-center px-2' src={soapboxConfig.logo} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|