Skip to content

Commit 333d7d2

Browse files
LivePreview - fix UI (#3667)
* LivePreview - fix UI * remove code color, add br to frame, change device width --------- Co-authored-by: Ethan Sharabi <[email protected]>
1 parent b3a607b commit 333d7d2

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

docuilib/src/components/UILivePreview.module.scss

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
$preview-width: 350px;
2-
$preview-margin: 60px;
1+
$preview-width: 340px;
2+
$preview-margin: 50px;
33
$editor-height: 700px;
44

55
.container {
66
display: flex;
7+
background-color: #1D1E21;
8+
border-radius: 8px;
9+
padding: 50px
710
}
811

912
.liveEditor {
1013
height: $editor-height;
14+
15+
span {
16+
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
17+
font-size: 14px;
18+
font-weight: 600;
19+
line-height: 24px;
20+
letter-spacing: -0.028px;
21+
}
1122
}
1223

1324
.codeContainer {
@@ -21,6 +32,8 @@ $editor-height: 700px;
2132
pre {
2233
min-height: 100%;
2334
padding: 20px !important;
35+
background-color: #1D1E21 !important;
36+
border-right: 1px solid #D2D6D8;
2437
}
2538
}
2639

@@ -29,14 +42,19 @@ $editor-height: 700px;
2942
bottom: 0;
3043
left: 0;
3144
right: 0;
45+
46+
pre {
47+
background-color: rgba(255, 255, 255, 0.80) !important;
48+
margin: 10px;
49+
}
3250
}
3351

3452
.preview {
3553
position: relative;
3654
width: $preview-width;
3755
margin-left: $preview-margin;
3856
border-radius: 36px;
39-
border: 1px solid #ddd;
57+
border: 10px solid rgba(255, 255, 255, 0.20);
4058
box-shadow: 0 0 15px rgba(110, 120, 129, 0.05);
4159
overflow: hidden;
4260
}
@@ -49,4 +67,5 @@ $editor-height: 700px;
4967
left: 0;
5068
border: 0;
5169
padding: 10;
70+
background-color: #fff;
5271
}

docuilib/src/components/pageComponents/SectionHeader.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React, {useMemo} from 'react';
2-
import '../ComponentPage.module.scss';
32
import showdownMarkdown from 'showdown';
43
import ReactHtmlParser from 'react-html-parser';
4+
import {isComponentSupported} from '../../utils/componentUtils';
5+
import '../ComponentPage.module.scss';
6+
57

68
export const SectionHeader = ({section, component}) => {
79
const {title, description, type} = section;
@@ -26,6 +28,7 @@ export const SectionHeader = ({section, component}) => {
2628
};
2729

2830
const getUsageTitle = () => {
31+
const title = isComponentSupported(component.name) ? 'Playground' : 'Usage';
2932
if (component.snippet) {
3033
return (
3134
<div

docuilib/src/pages/livePreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {IFRAME_MESSAGE_TYPE} from '@site/src/components/UILivePreview';
44
import ReactLiveScope from '../theme/ReactLiveScope';
55
import styles from './livePreview.module.css';
66

7-
export default function UILivePreview() {
7+
export default function LivePreviewWrapper() {
88
const [code, setCode] = useState(``);
99

1010
useEffect(() => {

0 commit comments

Comments
 (0)