-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2220 from daostack/dev
Sprint 30
- Loading branch information
Showing
69 changed files
with
1,319 additions
and
267 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
14 changes: 14 additions & 0 deletions
14
src/pages/MyAccount/components/Billing/Billing.module.scss
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,14 @@ | ||
@import "../../../../constants"; | ||
@import "../../../../styles/sizes"; | ||
|
||
.container { | ||
width: 100%; | ||
} | ||
|
||
.header { | ||
margin-bottom: 2.25rem; | ||
|
||
@include tablet { | ||
margin-bottom: 0; | ||
} | ||
} |
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
37 changes: 37 additions & 0 deletions
37
src/pages/MyAccount/components/Billing/components/Header/Header.module.scss
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,37 @@ | ||
@import "../../../../../../constants"; | ||
|
||
.desktopContainer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.desktopTitle { | ||
margin: 0; | ||
font-family: Lexend, sans-serif; | ||
font-weight: normal; | ||
font-size: 2.25rem; | ||
line-height: 3rem; | ||
} | ||
|
||
.topNavigationWithBlocks { | ||
z-index: 10; | ||
} | ||
|
||
.backIcon { | ||
flex-shrink: 0; | ||
width: 0.875rem; | ||
height: 0.875rem; | ||
} | ||
|
||
.mobileTitle { | ||
margin: 0; | ||
font-family: PoppinsSans, sans-serif; | ||
font-weight: 500; | ||
font-size: 1rem; | ||
text-align: center; | ||
color: $c-gray-100; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
} |
54 changes: 54 additions & 0 deletions
54
src/pages/MyAccount/components/Billing/components/Header/Header.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,54 @@ | ||
import React, { FC } from "react"; | ||
import { useHistory } from "react-router-dom"; | ||
import classNames from "classnames"; | ||
import { useRoutesContext } from "@/shared/contexts"; | ||
import { useGoBack } from "@/shared/hooks"; | ||
import { LongLeftArrowIcon } from "@/shared/icons"; | ||
import { | ||
TopNavigationBackButton, | ||
TopNavigationWithBlocks, | ||
} from "@/shared/ui-kit"; | ||
import styles from "./Header.module.scss"; | ||
|
||
interface HeaderProps { | ||
className?: string; | ||
isMobileVersion?: boolean; | ||
} | ||
|
||
const Header: FC<HeaderProps> = (props) => { | ||
const { className, isMobileVersion = false } = props; | ||
const history = useHistory(); | ||
const { canGoBack, goBack } = useGoBack(); | ||
const { getProfilePagePath } = useRoutesContext(); | ||
|
||
if (!isMobileVersion) { | ||
return ( | ||
<header className={classNames(styles.desktopContainer, className)}> | ||
<h1 className={styles.desktopTitle}>Billing</h1> | ||
</header> | ||
); | ||
} | ||
|
||
const handleBackButtonClick = () => { | ||
if (canGoBack) { | ||
goBack(); | ||
} else { | ||
history.push(getProfilePagePath()); | ||
} | ||
}; | ||
|
||
return ( | ||
<TopNavigationWithBlocks | ||
className={styles.topNavigationWithBlocks} | ||
leftElement={ | ||
<TopNavigationBackButton | ||
iconEl={<LongLeftArrowIcon className={styles.backIcon} />} | ||
onClick={handleBackButtonClick} | ||
/> | ||
} | ||
centralElement={<h2 className={styles.mobileTitle}>Billing</h2>} | ||
/> | ||
); | ||
}; | ||
|
||
export default Header; |
1 change: 1 addition & 0 deletions
1
src/pages/MyAccount/components/Billing/components/Header/index.ts
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 @@ | ||
export { default as Header } from "./Header"; |
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 @@ | ||
export * from "./Header"; |
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
Oops, something went wrong.