diff --git a/common/constants.js b/common/constants.js
index c586eee0..ae44cd8e 100644
--- a/common/constants.js
+++ b/common/constants.js
@@ -105,6 +105,7 @@ export const semantic = {
bgBlurBlack: "rgba(0, 5, 10, 0.5)",
bgBlurBlackOP: "rgba(0, 5, 10, 0.85)",
bgBlurBlackTRN: "rgba(0, 5, 10, 0.3)",
+ bgBlurDark: "rgba(28, 29, 30, 0.7)",
bgBlurDark6: "rgba(28, 29, 30, 0.5)",
bgBlurDark6OP: "rgba(28, 29, 30, 0.85)",
bgBlurDark6TRN: "rgba(28, 29, 30, 0.3)",
@@ -113,6 +114,7 @@ export const semantic = {
borderGrayLight: system.grayLight5,
borderDark: system.grayDark6,
borderGrayDark: system.grayDark5,
+ borderGrayLight4: system.grayLight4,
bgBlue: system.blueLight6,
bgGreen: system.greenLight6,
diff --git a/common/environment.js b/common/environment.js
index f5ed9623..f315491e 100644
--- a/common/environment.js
+++ b/common/environment.js
@@ -7,3 +7,8 @@ export const ACTIVITY_FEATURE_FLAG = NODE_ENV === "development" || NODE_ENV ===
export const URI_SHOVEL = process.env.NEXT_PUBLIC_URI_SHOVEL;
export const URI_FIJI = process.env.NEXT_PUBLIC_URI_FIJI;
export const URI_LENS = process.env.NEXT_PUBLIC_URI_LENS;
+
+//NOTE(amine): Extensions links
+export const EXTENSION_CHROME = process.env.NEXT_PUBLIC_EXTENSION_CHROME;
+export const EXTENSION_FIREFOX = process.env.NEXT_PUBLIC_EXTENSION_FIREFOX;
+export const EXTENSION_SAFARI = process.env.NEXT_PUBLIC_EXTENSION_SAFARI;
diff --git a/common/hooks.js b/common/hooks.js
index 159f442f..9a516ff1 100644
--- a/common/hooks.js
+++ b/common/hooks.js
@@ -173,15 +173,16 @@ export const useField = ({
if (event) event(e);
});
- /** ---------- NOTE(amine): Input Handlers ---------- */
- const handleFieldChange = (e) =>
+ const setFieldValue = (value) =>
setState((prev) => ({
...prev,
- value: e.target.value,
+ value,
error: undefined,
touched: false,
}));
+ /** ---------- NOTE(amine): Input Handlers ---------- */
+ const handleFieldChange = (e) => setFieldValue(e.target.value);
const handleOnBlur = () => {
// NOTE(amine): validate the inputs onBlur and touch the current input
let error = {};
@@ -204,10 +205,10 @@ export const useField = ({
if (!onSubmit) return;
setState((prev) => ({ ...prev, isSubmitting: true }));
onSubmit(state.value)
- .then(() => {
+ ?.then(() => {
setState((prev) => ({ ...prev, isSubmitting: false }));
})
- .catch(() => {
+ ?.catch(() => {
setState((prev) => ({ ...prev, isSubmitting: false }));
});
};
@@ -223,7 +224,7 @@ export const useField = ({
onSubmit: handleFormOnSubmit,
});
- return { getFieldProps, value: state.value, isSubmitting: state.isSubmitting };
+ return { getFieldProps, value: state.value, setFieldValue, isSubmitting: state.isSubmitting };
};
export const useIntersection = ({ onIntersect, ref }, dependencies = []) => {
diff --git a/common/strings.js b/common/strings.js
index 4d7285f9..95a3a2af 100644
--- a/common/strings.js
+++ b/common/strings.js
@@ -182,7 +182,7 @@ export const bytesToSize = (bytes, decimals = 2) => {
const i = Math.floor(Math.log(bytes) / Math.log(k));
- return `${(bytes / Math.pow(k, i)).toFixed(dm)} ${sizes[i]}`;
+ return `${(bytes / Math.pow(k, i)).toFixed(dm)}${sizes[i]}`;
};
export const getRemainingTime = (seconds) => {
diff --git a/common/utilities.js b/common/utilities.js
index ab24f7c8..9453a5c0 100644
--- a/common/utilities.js
+++ b/common/utilities.js
@@ -31,27 +31,6 @@ export const getImageUrlIfExists = (file, sizeLimit = null) => {
}
};
-export const getPublicAndPrivateFiles = ({ viewer }) => {
- let publicFileIds = [];
- for (let slate of viewer.slates) {
- if (slate.isPublic) {
- publicFileIds.push(...slate.objects.map((obj) => obj.id));
- }
- }
-
- let publicFiles = [];
- let privateFiles = [];
- let library = viewer.library || [];
- for (let file of library) {
- if (file.isPublic || publicFileIds.includes(file.id)) {
- publicFiles.push(file);
- } else {
- privateFiles.push(file);
- }
- }
- return { publicFiles, privateFiles };
-};
-
export const generateNumberByStep = ({ min, max, step = 1 }) => {
var numbers = [];
for (var n = min; n <= max; n += step) {
diff --git a/components/core/ApplicationHeader.js b/components/core/ApplicationHeader.js
index 3fd83cb1..f4e49b10 100644
--- a/components/core/ApplicationHeader.js
+++ b/components/core/ApplicationHeader.js
@@ -9,46 +9,43 @@ import {
ApplicationUserControlsPopup,
} from "~/components/core/ApplicationUserControls";
-import { css, keyframes } from "@emotion/react";
-import { Boundary } from "~/components/system/components/fragments/Boundary";
-import { PopoverNavigation } from "~/components/system";
+import { css } from "@emotion/react";
import { DarkSymbol } from "~/common/logo";
import { Link } from "~/components/core/Link";
import { ButtonPrimary, ButtonTertiary } from "~/components/system/components/Buttons";
+import { Match, Switch } from "~/components/utility/Switch";
+import { Show } from "~/components/utility/Show";
+import { useField, useMediaQuery } from "~/common/hooks";
+import { Input } from "~/components/system";
+import { AnimatePresence, motion } from "framer-motion";
-const STYLES_NAV_LINKS = css`
- display: flex;
- flex-direction: row;
-
- @media (max-width: ${Constants.sizes.mobile}px) {
- flex-direction: column;
- overflow: hidden;
+const STYLES_SEARCH_COMPONENT = (theme) => css`
+ background-color: transparent;
+ border-radius: 8px;
+ box-shadow: none;
+ height: 100%;
+ input {
+ height: 100%;
+ padding: 0px;
+ }
+ &::placeholder {
+ color: ${theme.semantic.textGray};
}
`;
-const STYLES_NAV_LINK = css`
- color: ${Constants.semantic.textGray};
- text-decoration: none;
- transition: 200ms ease color;
+const STYLES_DISMISS_BUTTON = (theme) => css`
display: block;
- cursor: pointer;
- padding: 4px 24px;
- font-size: ${Constants.typescale.lvl1};
-
- :hover {
- color: ${Constants.system.blue};
- }
-
- @media (max-width: ${Constants.sizes.mobile}px) {
- border-bottom: 1px solid ${Constants.system.grayLight2};
- margin: 0px 24px;
- padding: 12px 0px;
- ${Styles.P2};
- }
+ ${Styles.BUTTON_RESET};
+ color: ${theme.semantic.textGray};
`;
-const STYLES_APPLICATION_HEADER_CONTAINER = (theme) => css`
+const STYLES_APPLICATION_HEADER_BACKGROUND = (theme) => css`
+ position: absolute;
width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ z-index: -1;
background-color: ${theme.system.white};
box-shadow: 0 0 0 1px ${theme.semantic.bgGrayLight};
@@ -60,17 +57,12 @@ const STYLES_APPLICATION_HEADER_CONTAINER = (theme) => css`
`;
const STYLES_APPLICATION_HEADER = css`
- display: grid;
- grid-template-columns: 1fr auto 1fr;
- align-items: center;
- ${"" /* justify-content: space-between; */}
- width: 100%;
+ ${Styles.HORIZONTAL_CONTAINER_CENTERED};
height: ${Constants.sizes.header}px;
- ${"" /* padding: 0 24px 0 16px; */}
- padding: 0px 32px;
+ padding: 0px 24px;
@media (max-width: ${Constants.sizes.mobile}px) {
- padding: 0px 24px;
+ padding: 0px 16px;
width: 100%;
}
`;
@@ -83,11 +75,9 @@ const STYLES_LEFT = css`
`;
const STYLES_MIDDLE = css`
- min-width: 10%;
- width: 100%;
- padding: 0 24px;
- display: flex;
- justify-content: center;
+ flex-grow: 1;
+ height: 100%;
+ padding: 0 12px;
`;
const STYLES_RIGHT = css`
@@ -101,7 +91,7 @@ const STYLES_BACKGROUND = css`
position: absolute;
width: 100vw;
height: 100vh;
- background-color: ${Constants.semantic.bgBlurDark6};
+ background-color: ${Constants.semantic.bgBlurDark};
pointer-events: auto;
@keyframes fade-in {
@@ -116,307 +106,188 @@ const STYLES_BACKGROUND = css`
`;
const STYLES_UPLOAD_BUTTON = css`
+ ${Styles.CONTAINER_CENTERED};
+ ${Styles.BUTTON_RESET};
background-color: ${Constants.semantic.bgGrayLight};
border-radius: 8px;
width: 24px;
height: 24px;
cursor: pointer;
pointer-events: auto;
- ${Styles.CONTAINER_CENTERED};
`;
-export default class ApplicationHeader extends React.Component {
- keysPressed = {};
- searchModKey = this.props.isMac ? (
-
- Keyboard shortcuts -
-shift + click
-- select a range of items between two selections -
-shift + drag
-- select items by draging over them -
-alt + drag
-- deselect items by draging over them -
-