-
Notifications
You must be signed in to change notification settings - Fork 103
Custom user permissions UI #451
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ae43df0
deps: Installed rc-switch and terminal-web FormSwitch component
itsrachelfish 084f0a2
deps: Installed react-collapse
itsrachelfish 3c63b20
ui+common: Added components from terminal-web
itsrachelfish 4665cf3
ui+connect: Custom permissions page
itsrachelfish 45613bb
util+constants: PermissionUriMap for tracking which endpoints are nee…
itsrachelfish c3b1ba1
mobx: Created addSessionView, added support for custom sessions
itsrachelfish 3bc24b5
ui+connect: Custodial account support
itsrachelfish f470c13
api+lit: Updated litapi to include new account RPC
itsrachelfish 95c1ebd
mobx: Updated addSessionView to support custodial accounts
itsrachelfish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,117 @@ | ||
$switchPrefixCls: rc-switch; | ||
|
||
$duration: 0.3s; | ||
|
||
.rc-switch { | ||
position: relative; | ||
display: inline-block; | ||
box-sizing: border-box; | ||
width: 44px; | ||
height: 22px; | ||
line-height: 20px; | ||
padding: 0; | ||
vertical-align: middle; | ||
border-radius: 20px 20px; | ||
border: 1px solid #ccc; | ||
background-color: #ccc; | ||
cursor: pointer; | ||
transition: all $duration cubic-bezier(0.35, 0, 0.25, 1); | ||
|
||
&-inner { | ||
color: #fff; | ||
font-size: 12px; | ||
position: absolute; | ||
left: 24px; | ||
top: 0; | ||
} | ||
|
||
&:after { | ||
position: absolute; | ||
width: 18px; | ||
height: 18px; | ||
left: 2px; | ||
top: 1px; | ||
border-radius: 50% 50%; | ||
background-color: #fff; | ||
content: ' '; | ||
cursor: pointer; | ||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); | ||
transform: scale(1); | ||
transition: left $duration cubic-bezier(0.35, 0, 0.25, 1); | ||
animation-timing-function: cubic-bezier(0.35, 0, 0.25, 1); | ||
animation-duration: $duration; | ||
animation-name: rcSwitchOff; | ||
} | ||
|
||
&:hover:after { | ||
transform: scale(1.1); | ||
animation-name: rcSwitchOn; | ||
} | ||
|
||
&:focus { | ||
box-shadow: 0 0 0 2px tint(#2db7f5, 80%); | ||
outline: none; | ||
} | ||
|
||
&-checked { | ||
border: 1px solid #87d068; | ||
background-color: #87d068; | ||
|
||
.rc-switch-inner { | ||
left: 6px; | ||
} | ||
|
||
&:after { | ||
left: 22px; | ||
} | ||
} | ||
|
||
&-disabled { | ||
cursor: no-drop; | ||
background: #ccc; | ||
border-color: #ccc; | ||
|
||
&:after { | ||
background: #9e9e9e; | ||
animation-name: none; | ||
cursor: no-drop; | ||
} | ||
|
||
&:hover:after { | ||
transform: scale(1); | ||
animation-name: none; | ||
} | ||
} | ||
|
||
&-label { | ||
display: inline-block; | ||
line-height: 20px; | ||
font-size: 14px; | ||
padding-left: 10px; | ||
vertical-align: middle; | ||
white-space: normal; | ||
pointer-events: none; | ||
user-select: text; | ||
} | ||
} | ||
|
||
@keyframes rcSwitchOn { | ||
0% { | ||
transform: scale(1); | ||
} | ||
50% { | ||
transform: scale(1.25); | ||
} | ||
100% { | ||
transform: scale(1.1); | ||
} | ||
} | ||
|
||
@keyframes rcSwitchOff { | ||
0% { | ||
transform: scale(1.1); | ||
} | ||
100% { | ||
transform: scale(1); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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,76 @@ | ||
import React, { ReactNode } from 'react'; | ||
import styled from '@emotion/styled'; | ||
|
||
const Styled = { | ||
Wrapper: styled.div` | ||
position: relative; | ||
font-family: ${props => props.theme.fonts.work.light}; | ||
font-weight: 300; | ||
font-size: ${props => props.theme.sizes.s}; | ||
color: ${props => props.theme.colors.offWhite}; | ||
`, | ||
Input: styled.input` | ||
color: ${props => props.theme.colors.offWhite}; | ||
background-color: ${props => props.theme.colors.overlay}; | ||
border-width: 0; | ||
border-bottom: 1px solid ${props => props.theme.colors.gray}; | ||
padding: 5px 40px 5px 5px; | ||
width: 100%; | ||
|
||
&:active, | ||
&:focus { | ||
outline: none; | ||
border-bottom-color: ${props => props.theme.colors.white}; | ||
} | ||
|
||
&::placeholder { | ||
color: ${props => props.theme.colors.gray}; | ||
} | ||
|
||
// Fix color of the date picker icon in chrome | ||
::-webkit-calendar-picker-indicator { | ||
filter: invert(1); | ||
} | ||
`, | ||
Extra: styled.div` | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
background-color: transparent; | ||
padding: 5px; | ||
`, | ||
}; | ||
|
||
interface Props { | ||
label?: string; | ||
value?: string; | ||
extra?: ReactNode; | ||
placeholder?: string; | ||
className?: string; | ||
onChange?: (value: string) => void; | ||
} | ||
|
||
const FormDate: React.FC<Props> = ({ | ||
label, | ||
value, | ||
placeholder, | ||
extra, | ||
className, | ||
onChange, | ||
}) => { | ||
const { Wrapper, Input, Extra } = Styled; | ||
return ( | ||
<Wrapper className={className}> | ||
<Input | ||
type="date" | ||
value={value} | ||
onChange={e => onChange && onChange(e.target.value)} | ||
placeholder={placeholder} | ||
aria-label={label} | ||
/> | ||
{extra && <Extra>{extra}</Extra>} | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default FormDate; |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.