forked from glaserL/viasp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60a1528
commit 7781b4a
Showing
14 changed files
with
79 additions
and
65 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import React from 'react'; | ||
export const IconWrapper = React.lazy(() => import(/* webpackChunkName: "IconWrapper" */ './fragments/IconWrapper.react')); | ||
export const IconWrapper = React.lazy(() => import(/* webpackChunkName: "IconWrapper" */ './fragments/IconWrapper.react')); | ||
export const Settings = React.lazy(() => import(/* webpackChunkName: "Settings" */ './fragments/Settings.react')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React, {useState} from "react"; | ||
import {useColorPalette} from "../contexts/ColorPalette"; | ||
import {useHighlightedSymbol} from "../contexts/HighlightedSymbol"; | ||
import './settings.css' | ||
import { darken } from 'polished'; | ||
|
||
|
||
function makeClassNameFromMarkedSymbol(highlightedSymbol) { | ||
let className = `noselect toggle_part unselected ${highlightedSymbol.length === 0 ? "fadeOut" : "fadeIn"}`; | ||
return className; | ||
} | ||
|
||
function ClearMarked() { | ||
const [highlightedSymbol,, setHighlightedSymbol] = useHighlightedSymbol() | ||
const colorPalette = useColorPalette(); | ||
const className = makeClassNameFromMarkedSymbol(highlightedSymbol) | ||
const [isHovered, setIsHovered] = useState(false); | ||
const [isClicked, setIsClicked] = useState(false); | ||
|
||
let style1 = { | ||
background: colorPalette.success, | ||
color: colorPalette.dark, | ||
border: `1px solid ${colorPalette.dark}`}; | ||
|
||
if (isHovered) { | ||
style1.background = darken(0.08, style1.background); | ||
} | ||
if (isClicked) { | ||
style1.background= colorPalette.info; | ||
} | ||
|
||
const handleMouseEnter = () => setIsHovered(true); | ||
const handleMouseLeave = () => setIsHovered(false); | ||
const handleMouseDown = () => setIsClicked(true); | ||
const handleMouseUp = () => setIsClicked(false); | ||
|
||
return <span onClick={() => setHighlightedSymbol([])} | ||
className={className} | ||
style={style1} | ||
onMouseEnter={handleMouseEnter} | ||
onMouseLeave={handleMouseLeave} | ||
onMouseDown={handleMouseDown} | ||
onMouseUp={handleMouseUp}> | ||
clear marked symbols</span> | ||
} | ||
|
||
export default function Settings() { | ||
|
||
return <div className="settings noselect" > | ||
<ClearMarked/> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.