Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release latest fixes to Staging #908

Merged
merged 62 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
62991f1
security setting base
Mar 31, 2021
ae5df05
fix uncaught exception
FSM1 Apr 5, 2021
5920d57
fix lint
FSM1 Apr 5, 2021
c52ed9e
wip
Apr 6, 2021
ed3f587
Merge branch 'dev' of github.com:ChainSafe/files-ui into feat/tbaut-s…
Apr 6, 2021
9b664dd
rename effect
FSM1 Apr 6, 2021
009561a
hoist module instantiation
FSM1 Apr 6, 2021
d63789e
Update packages/files-ui/src/Contexts/ThresholdKeyContext.tsx
FSM1 Apr 6, 2021
7c6f678
create loggedinas and extract passwordform
Apr 6, 2021
808450e
lint
Apr 6, 2021
1f9b217
nonce.umod is not a function
Apr 6, 2021
6fc7e36
bump tkey and pw change working
Apr 6, 2021
c59dccf
Merge pull request #871 from ChainSafe/fix/uncaught-exception-logging…
FSM1 Apr 6, 2021
f56d3da
fix login page glitches
FSM1 Apr 6, 2021
44a1583
fix lint
FSM1 Apr 6, 2021
ee2ba69
Merge remote-tracking branch 'origin/dev' into fix/login-optimizations
FSM1 Apr 6, 2021
4e33303
mnemonic
Apr 7, 2021
f289044
translations
Apr 7, 2021
21ff6b3
Update packages/files-ui/src/Components/Modules/LoginModule/PasswordS…
Tbaut Apr 7, 2021
a5b5b77
Minor fixes + Updates to color manipulator (#874)
RyRy79261 Apr 7, 2021
5f67770
Dark mode fixed
RyRy79261 Apr 7, 2021
eb9fc26
reset login
FSM1 Apr 7, 2021
42d95c6
fix lint
FSM1 Apr 7, 2021
fec3a75
Merge pull request #879 from ChainSafe/fix/login-optimizations
FSM1 Apr 7, 2021
7471027
fix hover color for menus
Apr 7, 2021
2333faa
Merge pull request #887 from ChainSafe/fix/tbaut-hover-color
FSM1 Apr 7, 2021
ebb5763
Merge pull request #886 from ChainSafe/feat/tkey-darkmode
FSM1 Apr 7, 2021
219c912
merge dev
Apr 7, 2021
b42ddb2
bring it to tkcontext
Apr 7, 2021
72da72c
mobile padding
Apr 7, 2021
672680a
forgotten className
Apr 7, 2021
1fa4cd1
padding
Apr 8, 2021
1a08132
stray comments
Apr 8, 2021
2ebc246
Remove code duplication (#889)
Tbaut Apr 8, 2021
8dc5e53
Fixed loader
RyRy79261 Apr 8, 2021
7277b6b
Fixed selected all
RyRy79261 Apr 8, 2021
e3f2003
Resolved
RyRy79261 Apr 8, 2021
23a2927
Merge pull request #895 from ChainSafe/fix/select-all-892
FSM1 Apr 8, 2021
402e58c
Merge pull request #896 from ChainSafe/fix/mouse-highlight-issue-890
FSM1 Apr 8, 2021
5679919
Fixed padding issue
RyRy79261 Apr 8, 2021
660c07e
Merge pull request #894 from ChainSafe/fix/mobile-spinner-893
FSM1 Apr 8, 2021
7a3fa7c
better spacing
Apr 8, 2021
16e9482
some more margin
Apr 8, 2021
06b5a6f
Update packages/files-ui/src/Contexts/ThresholdKeyContext.tsx
FSM1 Apr 8, 2021
336a1c3
Merge pull request #877 from ChainSafe/feat/tbaut-settings-security-846
FSM1 Apr 8, 2021
38a79ed
folder validation (#899)
tanmoyAtb Apr 9, 2021
246a08c
added download support
tanmoyAtb Apr 9, 2021
f00634f
saved browsers settings (#865)
tanmoyAtb Apr 9, 2021
6b944b5
Merge branch 'dev' of github.com:imploy/ui into fix/bin-file-view-873
tanmoyAtb Apr 9, 2021
c293ae9
added path update
tanmoyAtb Apr 9, 2021
e4b88c8
clear search bucket id
FSM1 Apr 9, 2021
ddb2561
fix layout
FSM1 Apr 11, 2021
c30d9b2
fix lint
FSM1 Apr 11, 2021
261e0fc
Prevent the whole app from rerendering every 5s (#909)
Tbaut Apr 11, 2021
6218d46
remove console
FSM1 Apr 12, 2021
1703d79
Merge pull request #911 from ChainSafe/fix/share-transfer-modal-on-ta…
FSM1 Apr 12, 2021
32c1976
Merge pull request #905 from ChainSafe/fix/bin-file-view-873
FSM1 Apr 12, 2021
db095c1
Merge pull request #906 from ChainSafe/feat/home-folder-nav-885
FSM1 Apr 12, 2021
da1dc7e
Merge pull request #907 from ChainSafe/fix/search-bucket-to-reset-on-…
FSM1 Apr 12, 2021
78c7241
Fix: Search results all show as files (#914)
FSM1 Apr 12, 2021
6f7cce3
Fix double click opening the next file preview (#915)
Tbaut Apr 12, 2021
ef4366d
Rename tooltip and fixes (#912)
tanmoyAtb Apr 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/common-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"devDependencies": {
"@babel/core": "^7.12.10",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-image": "^2.0.6",
"@rollup/plugin-node-resolve": "^10.0.0",
"@storybook/addon-actions": "^5.3.21",
"@storybook/addon-contexts": "^5.3.19",
Expand Down
14 changes: 8 additions & 6 deletions packages/common-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import svgr from "@svgr/rollup"
import url from "rollup-plugin-url"
import babel from "rollup-plugin-babel"
import postcss from "rollup-plugin-postcss"
import image from "@rollup/plugin-image"

export default {
input: "./src/index.ts",
Expand All @@ -14,30 +15,31 @@ export default {
dir: "dist/",
exports: "named",
sourcemap: true,
strict: true,
strict: true
},
plugins: [
image(),
peerDepsExternal(),
resolve(),
commonjs(),
typescript(),
postcss({
plugins: [],
plugins: []
}),
url(),
svgr(),
babel({
exclude: "node_modules/**",
presets: ["@babel/preset-react", "@babel/preset-env"],
plugins: ["emotion"],
}),
plugins: ["emotion"]
})
],
external: [
"react",
"react-dom",
"@material-ui/styles",
"formik",
"react-toast-notifications",
"@chainsafe/common-theme",
],
"@chainsafe/common-theme"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react"
import { makeStyles, createStyles, ITheme } from "@chainsafe/common-theme"
import clsx from "clsx"
import ChainSafePng from "./logo.png"

const useStyles = makeStyles(({ overrides }: ITheme) =>
createStyles({
Expand All @@ -17,7 +18,7 @@ const ChainsafeFilesLogo: React.FC<{ className?: string }> = ({
const classes = useStyles()
return (
<img
src="ChainSafe-logo.png"
src={ChainSafePng}
alt="Chainsafe Logo"
className={clsx(classes.root, className)}
/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 40 additions & 19 deletions packages/common-components/src/ExpansionPanel/ExpansionPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode, useState } from "react"
import React, { ReactNode, useCallback, useState } from "react"
import { ITheme, makeStyles, createStyles } from "@chainsafe/common-theme"
import { Typography } from "../Typography"
import clsx from "clsx"
Expand Down Expand Up @@ -35,6 +35,7 @@ const useStyles = makeStyles(
}px`,
color: palette.additional["gray"][9],
cursor: "pointer",
display: "flex",
"&.basic": {
backgroundColor: palette.additional["gray"][2],
...overrides?.ExpansionPanel?.heading?.basic?.root,
Expand All @@ -56,6 +57,9 @@ const useStyles = makeStyles(
},
...overrides?.ExpansionPanel?.heading?.root
},
flexGrow: {
flex: 1
},
content: {
overflow: "hidden",
color: palette.additional["gray"][8],
Expand Down Expand Up @@ -90,37 +94,54 @@ export interface IExpansionPanelProps {
children?: ReactNode | ReactNode[] | null
active?: boolean
variant?: "basic" | "borderless"
iconPosition?: "left" | "right"
toggle?: (state: boolean) => void
injectedClasses?: {
root?: string
heading?: string
content?: string
}
}

const ExpansionPanel: React.FC<IExpansionPanelProps> = ({
children,
header,
variant = "basic",
toggle,
active
}: IExpansionPanelProps) => {
const ExpansionPanel = ({ children, header, iconPosition, variant = "basic", toggle, active, injectedClasses }: IExpansionPanelProps) => {
const classes = useStyles()
const [activeInternal, setActive] = useState(!!active)
const handleToggle = () => {
const handleToggle = useCallback(() => {
toggle && toggle(!activeInternal)
setActive(!activeInternal)
}
}, [activeInternal, toggle])

return (
<div className={clsx(classes.root, variant)}>
<div className={clsx(classes.root, variant, injectedClasses?.root)}>
<section
onClick={() => handleToggle()}
className={clsx(classes.heading, variant, {
["active"]: active != undefined ? active : activeInternal
})}
onClick={handleToggle}
className={clsx(
classes.heading,
variant,
injectedClasses?.heading,
{
["active"]: active !== undefined ? active : activeInternal
}
)}
>
<DirectionalRightIcon className={classes.icon} />
{iconPosition === "left" && <DirectionalRightIcon className={classes.icon} />}
<Typography>{header}</Typography>
{iconPosition === "right" && (
<>
<div className={classes.flexGrow} />
<DirectionalRightIcon className={classes.icon} />
</>
)}
</section>
<section
className={clsx(classes.content, variant, {
["active"]: active != undefined ? active : activeInternal
})}
className={clsx(
classes.content,
variant,
injectedClasses?.content,
{
["active"]: active !== undefined ? active : activeInternal
}
)}
>
{children}
</section>
Expand Down
7 changes: 1 addition & 6 deletions packages/common-components/src/TextInput/FormikTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ const FormikTextInput = React.forwardRef(
name={field.name}
value={field.value}
placeholder={placeholder}
captionMessage={
<>
{captionMessage && captionMessage}
{meta.touched && meta.error && `${meta.error}`}
</>
}
captionMessage={meta.error ? `${meta.error}` : captionMessage ? captionMessage : null}
state={meta.error ? "error" : undefined}
onChange={helpers.setValue}
autoFocus={autoFocus}
Expand Down
14 changes: 5 additions & 9 deletions packages/common-components/src/Toaster/ToasterWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import React from "react"
import React, { useCallback } from "react"
import ToasterContent from "./ToasterContent"
import {
useToasts,
AppearanceTypes,
Placement
} from "react-toast-notifications"
import { useToasts, AppearanceTypes, Placement } from "react-toast-notifications"

export interface IToasterMessage {
message: string
description?: string
appearance?: AppearanceTypes
autoDismiss?: boolean
onDismiss?(id: string): void
onDismiss?: (id: string) => void
}

export const useToaster = () => {
const { addToast } = useToasts()

const addToastMessage = (config: IToasterMessage) => {
const addToastMessage = useCallback((config: IToasterMessage) => {
addToast(
<ToasterContent
message={config.message}
Expand All @@ -29,7 +25,7 @@ export const useToaster = () => {
onDismiss: config.onDismiss
}
)
}
}, [addToast])

return {
addToastMessage
Expand Down
51 changes: 27 additions & 24 deletions packages/common-components/src/stories/Breadcrumb.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React, { useMemo } from "react"
import { action } from "@storybook/addon-actions"
import { boolean, withKnobs, text } from "@storybook/addon-knobs"
import { Breadcrumb } from "../Breadcrumb"
Expand All @@ -15,26 +15,29 @@ export const actionsData = {
homeClicked: action("Clicked link")
}

export const BreadcrumbStory = (): React.ReactNode => (
<>
<Breadcrumb
homeOnClick={() => actionsData.homeClicked()}
showDropDown={boolean("show dropdown", true)}
crumbs={[
{
text: text("breadcrumb 2", "Level 1 Clickable"),
onClick: () => actionsData.linkClick()
},
{
text: "Level 2"
},
{
text: "Level 3"
},
{
text: "Level 4"
}
]}
/>
</>
)
export const BreadcrumbStory = (): React.ReactNode => {
const crumbs = useMemo(() => ([
{
text: text("breadcrumb 2", "Level 1 Clickable"),
onClick: () => actionsData.linkClick()
},
{
text: "Level 2"
},
{
text: "Level 3"
},
{
text: "Level 4"
}
]), [])

return (
<>
<Breadcrumb
homeOnClick={() => actionsData.homeClicked()}
showDropDown={boolean("show dropdown", true)}
crumbs={crumbs}
/>
</>
)}
1 change: 1 addition & 0 deletions packages/common-components/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "*.png"
1 change: 1 addition & 0 deletions packages/common-themes/src/Defaults/GlobalStyling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DefaultThemeConfig, defaultFontFamilyStack } from "./ThemeConfig"

export const DefaultGlobalStyling = {
":root": {
"--ready": "true",
...DefaultPalette.root
},
html: {
Expand Down
4 changes: 2 additions & 2 deletions packages/common-themes/src/Defaults/ThemeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ const DefaultThemeConfig: IThemeConfig = {
blocker: 10000
},
shadows: {
shadow1: `0px 1px 4px ${fade(DefaultPalette.additional.gray[10], 0.15)}`,
shadow2: `0px 2px 8px ${fade(DefaultPalette.additional.gray[10], 0.25)}`
shadow1: `0px 1px 4px ${fade("#000000", 0.15)}`, // Gray[10] // TODO: #875
shadow2: `0px 2px 8px ${fade("#000000", 0.25)}` // Gray[10] // TODO: #875
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/common-themes/src/Hooks/useDoubleClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function useDoubleClick(actionSingleClick: () => void, actionDoubleClick:
// the duration between this click and the previous one
// is less than the value of delay = double-click
if (clickCount === 2) {
setClickCount(0)
actionDoubleClick && actionDoubleClick()
}

Expand Down
22 changes: 19 additions & 3 deletions packages/common-themes/src/utils/colorManipulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,38 @@ export function decomposeColor(color: string): IColorObject {

if (["rgb", "rgba", "hsl", "hsla", "var"].indexOf(type) === -1) {
throw new Error(
"Material-UI: Unsupported `%s` color.\n" +
`ChainSafe themes: Unsupported ${type} color.\n` +
"We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), var()."
)
}

let colorToParse = `${color}`

if (type === "var") {
colorToParse = getComputedStyle(document.documentElement).getPropertyValue(color.substr(marker + 1, color.length - 1))
// Check if loaded
if (!getComputedStyle(document.documentElement).getPropertyValue("--ready")) {
// throw new Error(
// "Css variable not loaded yet"
// )
// TODO: #875: Resolve variables not being loaded in time issue
console.debug("Css variable not loaded yet")
}

colorToParse = getComputedStyle(document.documentElement).getPropertyValue(color.replace("var(", "").replace(")", ""))
if (colorToParse.charAt(0) === "#") {
return decomposeColor(
hexToRgb(
colorToParse
)
)
}
}

const valuesStrings = colorToParse
.substring(marker + 1, colorToParse.length - 1)
.split(",")
const values = valuesStrings.map((value) => parseFloat(value))

const values = valuesStrings.map((value) => parseFloat(value))
return { type: type as ColorFormat, values: values as ColorValues }
}

Expand Down
Loading