From b2c7a30da6607b35f57e4e7a3e62710c89b3ba43 Mon Sep 17 00:00:00 2001 From: toast Date: Sun, 21 Feb 2021 18:29:21 -0700 Subject: [PATCH 1/2] filter button v2 --- scenes/SceneFilesFolder.js | 243 ++++++++++++++++++------------------- 1 file changed, 116 insertions(+), 127 deletions(-) diff --git a/scenes/SceneFilesFolder.js b/scenes/SceneFilesFolder.js index 0dccd0a1..cd286ef8 100644 --- a/scenes/SceneFilesFolder.js +++ b/scenes/SceneFilesFolder.js @@ -11,7 +11,6 @@ import { CheckBox } from "~/components/system/components/CheckBox.js"; import { Boundary } from "~/components/system/components/fragments/Boundary"; import { GlobalCarousel } from "~/components/system/components/GlobalCarousel"; import { getPublicAndPrivateFiles } from "~/common/utilities"; - import ScenePage from "~/components/core/ScenePage"; import DataView from "~/components/core/DataView"; import DataMeter from "~/components/core/DataMeterDetailed"; @@ -33,10 +32,14 @@ const STYLES_TOOLTIP_ANCHOR = css` border: 1px solid #f2f2f2; background-color: ${Constants.system.white}; border-radius: 2px; + right: 0px; + top: 50px; + width: 256px; + height: 216px; display: flex; - flex-direction: column; - align-items: center; - justify-content: flex-start; + flex-direction: row; + align-items: flex-start; + justify-content: space-around; box-shadow: 0px 8px 24px rgba(178, 178, 178, 0.2); position: absolute; z-index: ${Constants.zindex.tooltip}; @@ -45,24 +48,55 @@ const STYLES_TOOLTIP_ANCHOR = css` const STYLES_FILETYPE_TOOLTIP = css` display: flex; flex-direction: column; - justify-content: space-around; - height: 260px; + justify-content: flex-start; + align-items: center; + height: 80%; + width: 50%; + margin: 24px; + margin-top: 20px; + margin-bottom: 20px; `; const STYLES_PRIVACY_TOOLTIP = css` display: flex; flex-direction: column; - justify-content: space-around; - height: 120px; + justify-content: flex-start; + align-items: flex-start; + height: 40%; font-family: ${Constants.font.medium}; font-size: 16px; + width: 50%; + margin: 24px; + margin-top: 20px; + margin-bottom: 20px; +`; + +const STYLES_CHECKBOX_LABEL = css` + padding-top: 0; + position: relative; + top: -4px; + font-family: ${Constants.font.medium}; + font-size: 16px; +`; + +const STYLES_TOOLTIP_DIVIDER_CONTAINER = css` + height: 100%; + width: 1px; + display: flex; + flex-direction: column; + justify-content: center; +`; + +const STYLES_TOOLTIP_DIVIDER = css` + height: 80%; + border: 1px solid ${Constants.system.lightBorder}; + width: 1px; `; export default class SceneFilesFolder extends React.Component { state = { view: 0, - filetypeTooltip: false, - privacyTooltip: false, + filterTooltip: false, filters: { images: false, audio: false, @@ -75,12 +109,8 @@ export default class SceneFilesFolder extends React.Component { files: this.props.viewer?.library[0].children, }; - _handleFiletypeTooltip = () => { - this.setState({ filetypeTooltip: !this.state.filetypeTooltip }); - }; - - _handlePrivacyTooltip = () => { - this.setState({ privacyTooltip: !this.state.privacyTooltip }); + _handleFilterTooltip = () => { + this.setState({ filterTooltip: !this.state.filterTooltip }); }; _handlePrivacyFilter = (filter) => { @@ -255,22 +285,85 @@ export default class SceneFilesFolder extends React.Component { />
- - {this.state.privacy} + + - {this.state.privacyTooltip ? ( + {this.state.filterTooltip ? ( this.setState({ privacyTooltip: false })} + onOutsideRectEvent={() => this.setState({ filetypeTooltip: false })} > -
+
+
+
+ this._handleFiletypeFilter("images")} + boxStyle={{ height: 20, width: 20 }} + > + Images + +
+
+ this._handleFiletypeFilter("audio")} + boxStyle={{ height: 20, width: 20 }} + > + Audio + +
+
+ this._handleFiletypeFilter("assets")} + boxStyle={{ height: 20, width: 20 }} + > + Assets + +
+
+ this._handleFiletypeFilter("videos")} + boxStyle={{ height: 20, width: 20 }} + > + Videos + +
+
+ this._handleFiletypeFilter("books")} + boxStyle={{ height: 20, width: 20 }} + > + Books + +
+
+
+
+
this._handlePrivacyFilter("All")} > @@ -281,6 +374,7 @@ export default class SceneFilesFolder extends React.Component { color: this.state.privacy === "Private" ? Constants.system.brand : "inherit", cursor: "pointer", + marginTop: 17, }} onClick={() => this._handlePrivacyFilter("Private")} > @@ -290,6 +384,7 @@ export default class SceneFilesFolder extends React.Component { style={{ color: this.state.privacy === "Public" ? Constants.system.brand : "inherit", cursor: "pointer", + marginTop: 18, }} onClick={() => this._handlePrivacyFilter("Public")} > @@ -300,112 +395,6 @@ export default class SceneFilesFolder extends React.Component { ) : null}
-
- - - Filetype - - {this.state.filetypeTooltip ? ( - this.setState({ filetypeTooltip: false })} - > -
-
- this._handleFiletypeFilter("images")} - > - - Images - - - this._handleFiletypeFilter("audio")} - > - - Audio - - - this._handleFiletypeFilter("assets")} - > - - Assets - - - this._handleFiletypeFilter("videos")} - > - - Videos - - - this._handleFiletypeFilter("books")} - > - - Books - - -
-
-
- ) : null} -
{this.state.files?.length ? ( Date: Mon, 22 Feb 2021 13:22:13 -0700 Subject: [PATCH 2/2] small spacing change --- scenes/SceneFilesFolder.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scenes/SceneFilesFolder.js b/scenes/SceneFilesFolder.js index cd286ef8..d026d083 100644 --- a/scenes/SceneFilesFolder.js +++ b/scenes/SceneFilesFolder.js @@ -33,7 +33,7 @@ const STYLES_TOOLTIP_ANCHOR = css` background-color: ${Constants.system.white}; border-radius: 2px; right: 0px; - top: 50px; + top: 48px; width: 256px; height: 216px; display: flex; @@ -77,6 +77,7 @@ const STYLES_CHECKBOX_LABEL = css` top: -4px; font-family: ${Constants.font.medium}; font-size: 16px; + user-select: none; `; const STYLES_TOOLTIP_DIVIDER_CONTAINER = css` @@ -174,13 +175,13 @@ export default class SceneFilesFolder extends React.Component { } this.setState((prevState) => ({ files: filteredFiles, - filetypeTooltip: prevState.filetypeTooltip ? true : false, + filterTooltip: true, filtersActive: true, })); } else { this.setState((prevState) => ({ files: library, - filetypeTooltip: prevState.filetypeTooltip ? true : false, + filterTooltip: true, filtersActive: false, })); }