Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Commit c23585b

Browse files
author
ugistelmokaitis
committed
Update[browserWindow component]: fixed entire window component
1 parent 321ba8a commit c23585b

File tree

2 files changed

+88
-28
lines changed

2 files changed

+88
-28
lines changed

components/browserWindow.tsx

+67-28
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,85 @@
1-
import type { RichTextField } from '@prismicio/types';
21
import type { FC } from 'react';
32
import type React from 'react';
43
import SyntaxHighlighter from 'react-syntax-highlighter';
5-
import { hybrid } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
4+
import { hybrid, xcode } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
65

76
type IBrowseWindow = {
87
child1: React.ReactNode;
98
child2: React.ReactNode;
109
};
1110

1211
const BrowserWindow: FC<IBrowseWindow> = ({ child1, child2 }) => (
13-
<div className="drop-shadow-[0px_-10px_200px_rgba(26,86,219,0.50)] dark:drop-shadow-[0px_-10px_200px_rgba(119,197,227,0.50)]">
14-
<div className="grid-starts-1 pointer-events-none grid grid-cols-12 gap-16 pt-20">
15-
<div className="col-span-10 col-start-2 my-12">
16-
<div className="mx-auto">
17-
<div className="flex h-11 w-full items-center justify-start space-x-1.5 rounded-t-lg bg-[#0B0B0B] px-3 ">
18-
<div className="flex h-[2.7375rem] items-center justify-center border-r border-neutral-50 pr-[0.375rem]">
19-
<span className="font-codeRegular font-FiraCode_Regular text-codeMDRegular leading-[4rem] text-neutral-30">
20-
{child1}
21-
</span>
22-
<div className="ml-2 mr-2 h-[0.4063rem] w-[0.4063rem] rounded-full border-neutral-0 bg-neutral-30" />
12+
<>
13+
<div className="hidden dark:flex">
14+
<div className="container dark:drop-shadow-[0px_-10px_200px_rgba(119,197,227,0.50)]">
15+
<div className="grid-starts-1 gap-16 pt-20 md:grid-cols-12 lg:grid">
16+
<div className="col-span-10 col-start-2 my-12">
17+
<div className="mx-auto">
18+
<div className="flex h-11 w-full items-center justify-start space-x-1.5 rounded-t-lg bg-[#0B0B0B] px-3 ">
19+
<div className="flex h-[2.7375rem] items-center justify-center border-r border-neutral-50 pr-[0.375rem]">
20+
<span className="font-codeRegular font-FiraCode_Regular text-codeMDRegular leading-[4rem] text-neutral-30">
21+
{child1}
22+
</span>
23+
<div className="ml-2 mr-2 h-[0.4063rem] w-[0.4063rem] rounded-full border-neutral-0 bg-neutral-30" />
24+
</div>
25+
</div>
26+
<SyntaxHighlighter
27+
wrapLongLines
28+
wrapLines
29+
showLineNumbers
30+
style={hybrid}
31+
language="typescript"
32+
className="rounded-b-lg"
33+
customStyle={{
34+
paddingTop: '3rem',
35+
paddingBottom: '3rem',
36+
paddingLeft: '3rem',
37+
paddingRight: '3rem',
38+
}}
39+
>
40+
{child2 as string}
41+
</SyntaxHighlighter>
2342
</div>
2443
</div>
25-
<SyntaxHighlighter
26-
wrapLongLines
27-
wrapLines
28-
showLineNumbers
29-
style={hybrid}
30-
className="rounded-b-lg"
31-
customStyle={{
32-
paddingTop: '3rem',
33-
paddingBottom: '3rem',
34-
paddingLeft: '3rem',
35-
paddingRight: '3rem',
36-
}}
37-
>
38-
{child2 as string}
39-
</SyntaxHighlighter>
4044
</div>
4145
</div>
4246
</div>
43-
</div>
47+
<div>
48+
<div className="flex dark:hidden">
49+
<div className="container drop-shadow-[0px_-10px_200px_rgba(17,24,39,0.25)]">
50+
<div className="grid-starts-1 grid-cols-12 gap-16 pt-20 lg:grid">
51+
<div className="col-span-10 col-start-2 my-12">
52+
<div className="mx-auto">
53+
<div className="flex h-11 w-full items-center justify-start space-x-1.5 rounded-t-lg bg-primary-50 px-3 ">
54+
<div className="flex h-[2.7375rem] items-center justify-center border-r border-neutral-50 pr-[0.375rem]">
55+
<span className="font-codeRegular font-FiraCode_Regular text-codeMDRegular leading-[4rem] text-neutral-65">
56+
{child1}
57+
</span>
58+
<div className="ml-2 mr-2 h-[0.4063rem] w-[0.4063rem] rounded-full border-neutral-0 bg-neutral-50" />
59+
</div>
60+
</div>
61+
<SyntaxHighlighter
62+
wrapLongLines
63+
wrapLines
64+
showLineNumbers
65+
style={xcode}
66+
className="rounded-b-lg"
67+
customStyle={{
68+
paddingTop: '3rem',
69+
paddingBottom: '3rem',
70+
paddingLeft: '3rem',
71+
paddingRight: '3rem',
72+
}}
73+
>
74+
{child2 as string}
75+
</SyntaxHighlighter>
76+
</div>
77+
</div>
78+
</div>
79+
</div>
80+
</div>
81+
</div>
82+
</>
4483
);
4584

4685
export default BrowserWindow;

styles/globals.css

+21
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,24 @@
104104
position: relative;
105105
flex: 0 0 100%;
106106
}
107+
108+
.language-typescript {
109+
position: relative;
110+
}
111+
112+
.language-typescript > span {
113+
min-height: 1.5rem;
114+
padding-left: 3rem;
115+
116+
@apply flex md:block !important;
117+
}
118+
119+
.language-typescript > span > span {
120+
flex-shrink: 0;
121+
}
122+
123+
.language-typescript .linenumber {
124+
position: absolute;
125+
left: 0;
126+
opacity: 0.5;
127+
}

0 commit comments

Comments
 (0)