-
Notifications
You must be signed in to change notification settings - Fork 926
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
00fbd05
commit 7f696c5
Showing
7 changed files
with
121 additions
and
19 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
components/brave_wallet_ui/components/shared/animated-reveals/column-reveal.styles.tsx
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,25 @@ | ||
// Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// you can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import styled from 'styled-components' | ||
|
||
export const RevealableContentContainer = styled.div<{ hideContent?: boolean }>` | ||
--scroll-offset: ${(p) => p?.hideContent ? '-400px' : '0px'}; | ||
width: 100%; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
height: auto; | ||
` | ||
|
||
export const RevealableContentColumn = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: var(--scroll-offset); | ||
transition: margin-top .3s ease-in-out; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
` |
26 changes: 26 additions & 0 deletions
26
components/brave_wallet_ui/components/shared/animated-reveals/column-reveal.tsx
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,26 @@ | ||
// Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// you can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import * as React from 'react' | ||
import { RevealableContentContainer, RevealableContentColumn } from './column-reveal.styles' | ||
|
||
interface Props { | ||
hideContent?: boolean | ||
} | ||
|
||
export const ColumnReveal: React.FC<React.PropsWithChildren<Props>> = ({ | ||
children, | ||
hideContent | ||
}) => { | ||
return ( | ||
<RevealableContentContainer hideContent={hideContent}> | ||
<RevealableContentColumn> | ||
{children} | ||
</RevealableContentColumn> | ||
</RevealableContentContainer> | ||
) | ||
} | ||
|
||
export default ColumnReveal |
24 changes: 24 additions & 0 deletions
24
components/brave_wallet_ui/components/shared/animated-reveals/row-reveal.styles.tsx
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,24 @@ | ||
// Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// you can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import styled from 'styled-components' | ||
|
||
export const RevealableContentContainer = styled.div<{ hideContent?: boolean }>` | ||
--scroll-offset: ${(p) => p?.hideContent ? '-400px' : '0px'}; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
width: auto; | ||
` | ||
|
||
export const RevealableContentRow = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
margin-right: var(--scroll-offset); | ||
transition: margin-right .3s ease-in-out; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
` |
26 changes: 26 additions & 0 deletions
26
components/brave_wallet_ui/components/shared/animated-reveals/row-reveal.tsx
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,26 @@ | ||
// Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// you can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import * as React from 'react' | ||
import { RevealableContentContainer, RevealableContentRow } from './row-reveal.styles' | ||
|
||
interface Props { | ||
hideContent?: boolean | ||
} | ||
|
||
export const RowReveal: React.FC<React.PropsWithChildren<Props>> = ({ | ||
children, | ||
hideContent | ||
}) => { | ||
return ( | ||
<RevealableContentContainer hideContent={hideContent}> | ||
<RevealableContentRow> | ||
{children} | ||
</RevealableContentRow> | ||
</RevealableContentContainer> | ||
) | ||
} | ||
|
||
export default RowReveal |