Skip to content

Commit 84ac91b

Browse files
authored
feat: Adjust icons (#1109)
* feat: adjust icons * feat: adjust icons * fix: styles
1 parent 19431b6 commit 84ac91b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+309
-2129
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
1-
import { FC, ReactElement, useState } from 'react';
2-
import ReactMarkdown from 'react-markdown';
3-
import copy from 'copy-to-clipboard';
1+
import { FC, ReactElement, useState } from "react";
2+
import ReactMarkdown from "react-markdown";
3+
import copy from "copy-to-clipboard";
44
// @ts-ignore
5-
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
5+
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
66
// @ts-ignore
7-
import { okaidia } from 'react-syntax-highlighter/dist/esm/styles/prism';
8-
import remarkGfm from 'remark-gfm';
9-
import styles from './styles.module.scss';
10-
import React from 'react';
11-
import RightSvg from '../../Icons/Right';
7+
import { okaidia } from "react-syntax-highlighter/dist/esm/styles/prism";
8+
import remarkGfm from "remark-gfm";
9+
import styles from "./styles.module.scss";
10+
import React from "react";
11+
import RightSvg from "../@site/static/icons/arrowright.svg";
1212

1313
interface IProps {
14-
textContent: string
14+
textContent: string;
1515
}
16-
const AskDatabendMarkdown: FC<IProps> = ({ textContent }): ReactElement=> {
16+
const AskDatabendMarkdown: FC<IProps> = ({ textContent }): ReactElement => {
1717
const [isCopy, setIsCopy] = useState(false);
1818
return (
1919
<ReactMarkdown
2020
remarkPlugins={[remarkGfm]}
2121
components={{
22+
// @ts-ignore
2223
code({ inline, className, children, ...props }) {
23-
const match = /language-(\w+)/.exec(className || '');
24-
const text = String(children).replace(/\n$/, '');
25-
const language = match ? match[1] : 'sql';
24+
const match = /language-(\w+)/.exec(className || "");
25+
const text = String(children).replace(/\n$/, "");
26+
const language = match ? match[1] : "sql";
2627
return !inline && language ? (
27-
<div
28-
onMouseLeave={()=> setIsCopy(false)}
29-
className={styles.codeWrap}>
28+
<div
29+
onMouseLeave={() => setIsCopy(false)}
30+
className={styles.codeWrap}
31+
>
3032
<SyntaxHighlighter
3133
showLineNumbers={true}
3234
style={okaidia as any}
3335
language={language}
34-
PreTag='div'
36+
PreTag="div"
3537
{...props}
3638
>
3739
{text}
@@ -43,11 +45,7 @@ const AskDatabendMarkdown: FC<IProps> = ({ textContent }): ReactElement=> {
4345
setIsCopy(true);
4446
}}
4547
>
46-
{
47-
(isCopy)
48-
? <RightSvg />
49-
: <>Copy</>
50-
}
48+
{isCopy ? <RightSvg /> : <>Copy</>}
5149
</span>
5250
</div>
5351
) : (
@@ -56,28 +54,29 @@ const AskDatabendMarkdown: FC<IProps> = ({ textContent }): ReactElement=> {
5654
</code>
5755
);
5856
},
59-
a: (props: {href: string, children: string[]} | any) => {
57+
a: (props: { href: string; children: string[] } | any) => {
6058
const desc = props?.children[0];
6159
return (
62-
<a
63-
target="_blank"
64-
title={desc}
65-
rel="noopener noreferrer"
66-
href={props?.href}>
60+
<a
61+
target="_blank"
62+
title={desc}
63+
rel="noopener noreferrer"
64+
href={props?.href}
65+
>
6766
{desc}
6867
</a>
6968
);
7069
},
71-
table: ({...props}) => (
72-
<div style={{overflowX: 'auto', width: '100%'}}>
70+
table: ({ ...props }) => (
71+
<div style={{ overflowX: "auto", width: "100%" }}>
7372
<table {...props} />
7473
</div>
75-
)
74+
),
7675
}}
7776
>
7877
{textContent}
7978
</ReactMarkdown>
8079
);
8180
};
8281

83-
export default AskDatabendMarkdown;
82+
export default AskDatabendMarkdown;

src/components/CookiesConsent/index.js

+36-31
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
1-
import React, { useEffect } from 'react';
2-
import clsx from 'clsx';
3-
import Link from '@docusaurus/Link';
4-
import styles from './styles.module.scss';
5-
import { useState } from 'react';
6-
const COOKIE_KEY = 'COOKIE_KEY'
7-
import { Close } from '../Icons';
1+
import React, { useEffect } from "react";
2+
import clsx from "clsx";
3+
import Link from "@docusaurus/Link";
4+
import styles from "./styles.module.scss";
5+
import { useState } from "react";
6+
const COOKIE_KEY = "COOKIE_KEY";
7+
import Close from "@site/static/icons/close.svg";
88

99
function CookiesConsent() {
1010
const [isHidden, setIsHidden] = useState(true);
11-
const closePopup = ()=>{
12-
window['ga-disable-G-WBQPTTG4ZG'] = true;
11+
const closePopup = () => {
12+
window["ga-disable-G-WBQPTTG4ZG"] = true;
1313
setCookiesKey();
14-
}
15-
const acceptAll = ()=>{
16-
window['ga-disable-G-WBQPTTG4ZG'] = false;
14+
};
15+
const acceptAll = () => {
16+
window["ga-disable-G-WBQPTTG4ZG"] = false;
1717
setCookiesKey();
18-
19-
}
20-
useEffect(()=>{
18+
};
19+
useEffect(() => {
2120
const isAccept = window.localStorage.getItem(COOKIE_KEY);
2221
if (!isAccept) {
2322
setIsHidden(false);
2423
}
25-
})
24+
});
2625
function setCookiesKey() {
2726
window.localStorage.setItem(COOKIE_KEY, 1);
2827
setIsHidden(true);
2928
}
3029
return (
31-
<>
32-
{
33-
!isHidden && <div className={clsx(styles.consentWrap)}>
34-
<p>
35-
<span>We use cookies on our site to provide you with better user experience. You can view our Cookies Policy in </span>
36-
<Link href="https://databend.com/privacy/"> Privacy Policy</Link> .
37-
</p>
38-
<div className={styles.right}>
39-
<button onClick={acceptAll} className={styles.button}>ACCEPT</button>
40-
<div onClick={closePopup} className={styles.close}><Close size={24}/></div>
41-
</div>
42-
</div>
43-
}
44-
</>
45-
30+
<>
31+
{!isHidden && (
32+
<div className={clsx(styles.consentWrap)}>
33+
<p>
34+
<span>
35+
We use cookies on our site to provide you with better user
36+
experience. You can view our Cookies Policy in{" "}
37+
</span>
38+
<Link href="https://databend.com/privacy/"> Privacy Policy</Link> .
39+
</p>
40+
<div className={styles.right}>
41+
<button onClick={acceptAll} className={styles.button}>
42+
ACCEPT
43+
</button>
44+
<div onClick={closePopup} className={styles.close}>
45+
<Close />
46+
</div>
47+
</div>
48+
</div>
49+
)}
50+
</>
4651
);
4752
}
4853

src/components/CustomBlog/BlogList.js

-68
This file was deleted.

0 commit comments

Comments
 (0)