未验证 提交 3cc13f17 编写于 作者: M Méril 提交者: GitHub

feat(console): minor improvements for the demo (#403)

- Rename "Saved Queries" to "Example Queries"
- Show Query Result timings by default
- Format number according to user locales
- Animation in Toast notification stands out more now
- Fix horizontal scrollbar issue in grid
上级 b02dfd98
...@@ -12,7 +12,7 @@ export const Toast = styled.div<{ borderColor: Color }>` ...@@ -12,7 +12,7 @@ export const Toast = styled.div<{ borderColor: Color }>`
background: ${color("draculaBackgroundDarker")}; background: ${color("draculaBackgroundDarker")};
border: 2px solid ${color("draculaSelection")}; border: 2px solid ${color("draculaSelection")};
&:after { &:before {
position: absolute; position: absolute;
display: block; display: block;
content: " "; content: " ";
......
...@@ -156,7 +156,7 @@ const Menu = () => { ...@@ -156,7 +156,7 @@ const Menu = () => {
trigger={ trigger={
<QueryPickerButton onClick={handleClick}> <QueryPickerButton onClick={handleClick}>
<Add size="18px" /> <Add size="18px" />
<span>Saved queries</span> <span>Example queries</span>
</QueryPickerButton> </QueryPickerButton>
} }
> >
......
...@@ -72,7 +72,7 @@ const formatTiming = (nanos: number) => { ...@@ -72,7 +72,7 @@ const formatTiming = (nanos: number) => {
} }
const QueryResult = ({ compiler, count, execute, fetch, rowCount }: Props) => { const QueryResult = ({ compiler, count, execute, fetch, rowCount }: Props) => {
const [expanded, setExpanded] = useState(false) const [expanded, setExpanded] = useState(true)
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
setExpanded(!expanded) setExpanded(!expanded)
}, [expanded]) }, [expanded])
...@@ -81,7 +81,7 @@ const QueryResult = ({ compiler, count, execute, fetch, rowCount }: Props) => { ...@@ -81,7 +81,7 @@ const QueryResult = ({ compiler, count, execute, fetch, rowCount }: Props) => {
<Wrapper _height={95} duration={TransitionDuration.FAST}> <Wrapper _height={95} duration={TransitionDuration.FAST}>
<div> <div>
<Text color="draculaForeground"> <Text color="draculaForeground">
{rowCount} row{rowCount > 1 ? "s" : ""} in&nbsp; {rowCount.toLocaleString()} row{rowCount > 1 ? "s" : ""} in&nbsp;
{formatTiming(fetch)}&nbsp; {formatTiming(fetch)}&nbsp;
</Text> </Text>
( (
......
...@@ -20,6 +20,7 @@ const Wrapper = styled(Toast)` ...@@ -20,6 +20,7 @@ const Wrapper = styled(Toast)`
margin-top: 1rem; margin-top: 1rem;
padding-right: 3rem; padding-right: 3rem;
border-right: none; border-right: none;
border-bottom: none;
box-shadow: ${color("black")} 0 0 4px; box-shadow: ${color("black")} 0 0 4px;
overflow: hidden; overflow: hidden;
...@@ -66,10 +67,29 @@ const Out = styled.div<{ animationPlay: AnimationPlay }>` ...@@ -66,10 +67,29 @@ const Out = styled.div<{ animationPlay: AnimationPlay }>`
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 1px; height: 2px;
background: ${color("gray2")};
animation: ${disappear} 120s linear 0s 1 normal forwards; :before {
animation-play-state: ${({ animationPlay }) => animationPlay}; content: " ";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
background: ${color("draculaSelection")};
}
:after {
content: " ";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
background: ${color("gray2")};
animation: ${disappear} 120s linear 0s 1 normal forwards;
animation-play-state: ${({ animationPlay }) => animationPlay};
}
` `
const Pin = styled(Pushpin2)` const Pin = styled(Pushpin2)`
......
...@@ -122,7 +122,7 @@ const Result = () => { ...@@ -122,7 +122,7 @@ const Result = () => {
<ButtonWrapper> <ButtonWrapper>
{count && !sm && ( {count && !sm && (
<Text color="draculaForeground"> <Text color="draculaForeground">
{`${count} row${count > 1 ? "s" : ""}`} {`${count.toLocaleString()} row${count > 1 ? "s" : ""}`}
</Text> </Text>
)} )}
......
...@@ -41,8 +41,8 @@ body { ...@@ -41,8 +41,8 @@ body {
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 10px;
height: 11px; height: 10px;
background: #21222c; background: #21222c;
} }
...@@ -60,11 +60,11 @@ body { ...@@ -60,11 +60,11 @@ body {
} }
.ace_scrollbar-v { .ace_scrollbar-v {
width: 8px !important; width: 10px !important;
} }
.ace_scrollbar-h { .ace_scrollbar-h {
height: 8px !important; height: 10px !important;
} }
html, html,
......
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
.qg-header-row { .qg-header-row {
overflow: hidden; overflow: hidden;
height: 33px; height: 33px;
.qg-header:last-child {
margin-right: 10px;
}
} }
.qg-header-row, .qg-header-row,
...@@ -96,7 +100,6 @@ ...@@ -96,7 +100,6 @@
.qg-canvas { .qg-canvas {
position: relative; position: relative;
overflow: hidden;
width: 100%; width: 100%;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册