@mycause/ui 0.0.0-ce837d6b → 0.0.0-cec05abe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +267 -0
- package/README.md +9 -0
- package/dist/components/button-select/button-select.d.ts +12 -0
- package/dist/components/button-select/button-select.stories.d.ts +13 -0
- package/dist/components/button-select/index.d.ts +1 -0
- package/dist/components/campaign-card/campaign-card.d.ts +9 -0
- package/dist/components/campaign-card/campaign-card.stories.d.ts +14 -0
- package/dist/components/campaign-card/index.d.ts +1 -0
- package/dist/components/campaign-of-month/campaign-of-month.d.ts +15 -0
- package/dist/components/campaign-of-month/campaign-of-month.stories.d.ts +14 -0
- package/dist/components/campaign-of-month/index.d.ts +1 -0
- package/dist/components/charity-card/charity-card.d.ts +7 -0
- package/dist/components/charity-card/charity-card.stories.d.ts +14 -0
- package/dist/components/charity-card/index.d.ts +1 -0
- package/dist/components/combo-field/combo-field.d.ts +4 -1
- package/dist/components/comment-section/comment-section-v2/comment-section-v2.d.ts +31 -0
- package/dist/components/comment-section/comment-section-v2/sub-comments-v2.d.ts +11 -0
- package/dist/components/comment-section/comment-section.d.ts +24 -0
- package/dist/components/comment-section/comment-section.stories.d.ts +19 -0
- package/dist/components/comment-section/index.d.ts +2 -0
- package/dist/components/comment-section/sub-comments.d.ts +6 -0
- package/dist/components/cropper/cropper.d.ts +5 -4
- package/dist/components/cropper/cropper.stories.d.ts +1 -2
- package/dist/components/date-picker/date-picker.stories.d.ts +6 -0
- package/dist/components/date-picker/single-date-picker-custom-header.d.ts +31 -0
- package/dist/components/date-picker/single-date-picker.d.ts +3 -2
- package/dist/components/donate-card/donate-card.d.ts +8 -0
- package/dist/components/donate-card/donate-card.stories.d.ts +14 -0
- package/dist/components/donate-card/index.d.ts +1 -0
- package/dist/components/donate-card copy/donate-card.d.ts +8 -0
- package/dist/components/donate-card copy/donate-card.stories.d.ts +14 -0
- package/dist/components/donate-card copy/index.d.ts +1 -0
- package/dist/components/donation-form/donation-details.d.ts +12 -0
- package/dist/components/donation-form/donation-form-v2/donation-form-v2.d.ts +13 -0
- package/dist/components/donation-form/donation-form.d.ts +64 -0
- package/dist/components/donation-form/donation-form.stories.d.ts +18 -0
- package/dist/components/donation-form/donation-payment.d.ts +13 -0
- package/dist/components/donation-form/donation-select.d.ts +13 -0
- package/dist/components/donation-form/index.d.ts +2 -0
- package/dist/components/elevation/elevation.d.ts +2 -1
- package/dist/components/favorite-charity-item/favorite-charity-item.d.ts +15 -0
- package/dist/components/favorite-charity-item/favorite-charity-item.stories.d.ts +15 -0
- package/dist/components/favorite-charity-item/index.d.ts +1 -0
- package/dist/components/featured-campaign-card/featured-campaign-card.d.ts +17 -0
- package/dist/components/featured-campaign-card/featured-campaign-card.stories.d.ts +14 -0
- package/dist/components/featured-campaign-card/index.d.ts +1 -0
- package/dist/components/field-helpers/field-label.d.ts +2 -1
- package/dist/components/footerV2/footerV2.d.ts +35 -0
- package/dist/components/footerV2/footerV2.stories.d.ts +15 -0
- package/dist/components/footerV2/index.d.ts +1 -0
- package/dist/components/fundraising-section/fundraising-section.d.ts +9 -0
- package/dist/components/fundraising-section/fundraising-section.stories.d.ts +14 -0
- package/dist/components/fundraising-section/index.d.ts +1 -0
- package/dist/components/hero-banner/hero-banner.d.ts +9 -0
- package/dist/components/hero-banner/hero-banner.stories.d.ts +14 -0
- package/dist/components/hero-banner/index.d.ts +1 -0
- package/dist/components/horizontalbar/horizontalbar.d.ts +11 -0
- package/dist/components/horizontalbar/horizontalbar.stories.d.ts +26 -0
- package/dist/components/horizontalbar/index.d.ts +1 -0
- package/dist/components/icon/{toggle-button.d.ts → heart-toggle.d.ts} +3 -3
- package/dist/components/icon/{toggle-button.stories.d.ts → heart-toggle.stories.d.ts} +1 -1
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/index.d.ts +41 -1
- package/dist/components/info-represent-campaign/index.d.ts +1 -0
- package/dist/components/info-represent-campaign/info-represent-campaign.d.ts +11 -0
- package/dist/components/info-represent-campaign/info-represent-campaign.stories.d.ts +12 -0
- package/dist/components/input/InputDefault.d.ts +13 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/input.stories.d.ts +24 -0
- package/dist/components/list/list.d.ts +29 -14
- package/dist/components/list/list.stories.d.ts +8 -2
- package/dist/components/login/index.d.ts +1 -0
- package/dist/components/login/login.d.ts +15 -0
- package/dist/components/login/login.stories.d.ts +19 -0
- package/dist/components/logo/logo-type.d.ts +2 -1
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/modal-image.d.ts +8 -0
- package/dist/components/modal/modal.d.ts +7 -3
- package/dist/components/modal/modal.stories.d.ts +18 -0
- package/dist/components/my-account-choose-charity-card/index.d.ts +1 -0
- package/dist/components/my-account-choose-charity-card/my-account-choose-charity-card.d.ts +11 -0
- package/dist/components/my-account-choose-charity-card/my-account-choose-charity-card.stories.d.ts +14 -0
- package/dist/components/my-account-frp-closed/Icon.d.ts +5 -0
- package/dist/components/my-account-frp-closed/frp-closed-img.d.ts +9 -0
- package/dist/components/my-account-frp-closed/frp-information.d.ts +13 -0
- package/dist/components/my-account-frp-closed/index.d.ts +1 -0
- package/dist/components/my-account-frp-closed/my-account-frp-closed.d.ts +17 -0
- package/dist/components/my-account-frp-closed/my-account-frp-closed.stories.d.ts +24 -0
- package/dist/components/my-account-frp-preview/Icon.d.ts +5 -0
- package/dist/components/my-account-frp-preview/frp-information.d.ts +13 -0
- package/dist/components/my-account-frp-preview/frp-preview-img.d.ts +9 -0
- package/dist/components/my-account-frp-preview/index.d.ts +1 -0
- package/dist/components/my-account-frp-preview/my-account-frp-preview.d.ts +17 -0
- package/dist/components/my-account-frp-preview/my-account-frp-preview.stories.d.ts +24 -0
- package/dist/components/my-account-sidebar/Icon.d.ts +15 -0
- package/dist/components/my-account-sidebar/index.d.ts +1 -0
- package/dist/components/my-account-sidebar/my-account-sidebar.d.ts +18 -0
- package/dist/components/{phone-number-field/phone-number-field.stories.d.ts → my-account-sidebar/my-account-sidebar.stories.d.ts} +1 -1
- package/dist/components/my-account-start-fundraise-card/index.d.ts +1 -0
- package/dist/components/my-account-start-fundraise-card/my-account-start-fundraise-card.d.ts +11 -0
- package/dist/components/my-account-start-fundraise-card/my-account-start-fundraise-card.stories.d.ts +14 -0
- package/dist/components/my-account-stats-donated/index.d.ts +1 -0
- package/dist/components/my-account-stats-donated/my-account-stats-donated.d.ts +8 -0
- package/dist/components/my-account-stats-donated/my-account-stats-donated.stories.d.ts +12 -0
- package/dist/components/my-account-stats-raised/index.d.ts +1 -0
- package/dist/components/my-account-stats-raised/my-account-stats-raised.d.ts +8 -0
- package/dist/components/my-account-stats-raised/my-account-stats-raised.stories.d.ts +12 -0
- package/dist/components/nav/icons/IconBigger.d.ts +5 -0
- package/dist/components/nav/icons/IconSmaller.d.ts +5 -0
- package/dist/components/nav/index.d.ts +2 -0
- package/dist/components/nav/nav-actions.d.ts +5 -0
- package/dist/components/nav/nav-bar.d.ts +7 -0
- package/dist/components/nav/nav-call-to-action.d.ts +5 -0
- package/dist/components/nav/nav-expanded-charity.d.ts +14 -0
- package/dist/components/nav/nav-expanded.d.ts +14 -0
- package/dist/components/nav/nav-list.d.ts +29 -0
- package/dist/components/nav/nav-menu-control.d.ts +8 -0
- package/dist/components/nav/nav-menu.d.ts +12 -0
- package/dist/components/nav/nav-myaccount.d.ts +22 -0
- package/dist/components/nav/nav-search-control.d.ts +8 -0
- package/dist/components/nav/nav-search.d.ts +10 -0
- package/dist/components/nav/nav-sign-in-control.d.ts +12 -0
- package/dist/components/nav/nav-user-menu-items.d.ts +20 -0
- package/dist/components/nav/nav-user-menu.d.ts +18 -0
- package/dist/components/nav/nav.d.ts +57 -0
- package/dist/components/nav/nav.stories.d.ts +17 -0
- package/dist/components/navigation/navigation-list.d.ts +3 -1
- package/dist/components/navigation/navigation-menu.d.ts +2 -1
- package/dist/components/navigation/navigation-sign-in-control.d.ts +6 -3
- package/dist/components/navigation/navigation.d.ts +12 -1
- package/dist/components/navigation/navigation.stories.d.ts +3 -21
- package/dist/components/partner-chart-stats/index.d.ts +1 -0
- package/dist/components/partner-chart-stats/partner-chart-stats.d.ts +11 -0
- package/dist/components/partner-chart-stats/partner-chart-stats.stories.d.ts +18 -0
- package/dist/components/partner-monthly-donations/index.d.ts +1 -0
- package/dist/components/partner-monthly-donations/partner-monthly-donations.d.ts +8 -0
- package/dist/components/partner-monthly-donations/partner-monthly-donations.stories.d.ts +12 -0
- package/dist/components/partner-monthly-stats/index.d.ts +1 -0
- package/dist/components/partner-monthly-stats/partner-monthly-stats.d.ts +7 -0
- package/dist/components/partner-monthly-stats/partner-monthly-stats.stories.d.ts +12 -0
- package/dist/components/partner-toggle-button/index.d.ts +2 -0
- package/dist/components/partner-toggle-button/partner-toggle-button-block.d.ts +11 -0
- package/dist/components/partner-toggle-button/partner-toggle-button-block.stories.d.ts +12 -0
- package/dist/components/partner-toggle-button/partner-toggle-button.d.ts +8 -0
- package/dist/components/phone-number-input/index.d.ts +4 -0
- package/dist/components/phone-number-input/phone-number-input-v1.d.ts +25 -0
- package/dist/components/phone-number-input/phone-number-input-v2.d.ts +19 -0
- package/dist/components/{phone-number-field/phone-number-field.d.ts → phone-number-input/phone-number-input.d.ts} +5 -3
- package/dist/components/phone-number-input/phone-number-input.stories.d.ts +31 -0
- package/dist/components/popup/index.d.ts +1 -0
- package/dist/components/popup/popup.d.ts +8 -0
- package/dist/components/popup/popup.stories.d.ts +14 -0
- package/dist/components/progressbar/index.d.ts +1 -0
- package/dist/components/progressbar/progress-bar-circle.d.ts +10 -0
- package/dist/components/progressbar/progressbar.d.ts +8 -0
- package/dist/components/progressbar/progressbar.stories.d.ts +20 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/select-enhanced.d.ts +23 -0
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/select.stories.d.ts +6 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/spinner.d.ts +8 -0
- package/dist/components/spinner/spinner.stories.d.ts +13 -0
- package/dist/components/start-campaign-card/index.d.ts +1 -0
- package/dist/components/start-campaign-card/start-campaign-card.d.ts +8 -0
- package/dist/components/start-campaign-card/start-campaign-card.stories.d.ts +14 -0
- package/dist/components/statistics/statistics.d.ts +2 -1
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/partner-monthly-table.d.ts +17 -0
- package/dist/components/table/partner-monthly-table.stories.d.ts +18 -0
- package/dist/components/tabs/nav-tabs.d.ts +18 -0
- package/dist/components/tabs/tabs.d.ts +3 -1
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/text-field/index.d.ts +1 -0
- package/dist/components/text-field/text-field-search.d.ts +9 -0
- package/dist/components/text-field/text-field.d.ts +1 -0
- package/dist/components/text-field/text-field.stories.d.ts +6 -0
- package/dist/components/this-month-card/index.d.ts +1 -0
- package/dist/components/this-month-card/this-month-card.d.ts +15 -0
- package/dist/components/this-month-card/this-month-card.stories.d.ts +12 -0
- package/dist/components/transaction-card/Dot.d.ts +6 -0
- package/dist/components/transaction-card/donate-card.d.ts +8 -0
- package/dist/components/transaction-card/donate-card.stories.d.ts +14 -0
- package/dist/components/transaction-card/index.d.ts +1 -0
- package/dist/components/transaction-card/transaction-card.d.ts +13 -0
- package/dist/components/transaction-card/transaction-card.stories.d.ts +14 -0
- package/dist/components/transaction-card/transaction-cardstories.d.ts +14 -0
- package/dist/index.esm.js +33642 -6329
- package/dist/index.js +33977 -6620
- package/dist/theme/theme.d.ts +4 -0
- package/dist/utils/parse-numbers.d.ts +2 -0
- package/package.json +4 -1
- package/styles/index.css +5 -0
- package/dist/components/anchor/anchor.jsx +0 -35
- package/dist/components/anchor/anchor.stories.jsx +0 -12
- package/dist/components/anchor/bold-anchor.jsx +0 -33
- package/dist/components/anchor/bold-anchor.stories.jsx +0 -11
- package/dist/components/anchor/index.js +0 -2
- package/dist/components/avatar/avatar.jsx +0 -14
- package/dist/components/avatar/avatar.stories.jsx +0 -17
- package/dist/components/avatar/image-avatar.jsx +0 -29
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/avatar/text-avatar.jsx +0 -47
- package/dist/components/button/button.jsx +0 -85
- package/dist/components/button/button.stories.jsx +0 -118
- package/dist/components/button/index.js +0 -1
- package/dist/components/checkbox/checkbox.jsx +0 -39
- package/dist/components/checkbox/checkbox.stories.jsx +0 -42
- package/dist/components/checkbox/index.js +0 -1
- package/dist/components/chips/chip.jsx +0 -30
- package/dist/components/chips/chips.jsx +0 -16
- package/dist/components/chips/chips.stories.jsx +0 -35
- package/dist/components/chips/index.js +0 -3
- package/dist/components/chips/input-chips.jsx +0 -16
- package/dist/components/chips/input-chips.stories.jsx +0 -39
- package/dist/components/combo-field/combo-field-expander.jsx +0 -23
- package/dist/components/combo-field/combo-field.jsx +0 -93
- package/dist/components/combo-field/combo-field.stories.jsx +0 -62
- package/dist/components/combo-field/index.js +0 -2
- package/dist/components/cropper/cropper.jsx +0 -15
- package/dist/components/cropper/cropper.stories.jsx +0 -18
- package/dist/components/cropper/index.js +0 -1
- package/dist/components/date-picker/date-picker.jsx +0 -74
- package/dist/components/date-picker/date-picker.stories.jsx +0 -46
- package/dist/components/date-picker/index.js +0 -2
- package/dist/components/date-picker/single-date-picker.jsx +0 -81
- package/dist/components/elevation/elevation.jsx +0 -19
- package/dist/components/elevation/elevation.stories.jsx +0 -31
- package/dist/components/elevation/index.js +0 -1
- package/dist/components/field-helpers/field-helper-text.jsx +0 -42
- package/dist/components/field-helpers/field-label.jsx +0 -29
- package/dist/components/field-helpers/index.js +0 -2
- package/dist/components/icon/btn_google_light_normal_ios.svg.jsx +0 -21
- package/dist/components/icon/facebook_6.svg.jsx +0 -13
- package/dist/components/icon/icon-button-group.jsx +0 -51
- package/dist/components/icon/icon-button-group.stories.jsx +0 -26
- package/dist/components/icon/icon-button.jsx +0 -48
- package/dist/components/icon/icon-button.stories.jsx +0 -33
- package/dist/components/icon/icon.jsx +0 -49
- package/dist/components/icon/icon.stories.jsx +0 -78
- package/dist/components/icon/index.js +0 -4
- package/dist/components/icon/material-icon.jsx +0 -18
- package/dist/components/icon/toggle-button.jsx +0 -29
- package/dist/components/icon/toggle-button.stories.jsx +0 -16
- package/dist/components/index.js +0 -27
- package/dist/components/layout/box.jsx +0 -58
- package/dist/components/layout/flex.jsx +0 -55
- package/dist/components/layout/flex.stories.jsx +0 -44
- package/dist/components/layout/grid.jsx +0 -19
- package/dist/components/layout/grid.stories.jsx +0 -29
- package/dist/components/layout/index.js +0 -4
- package/dist/components/layout/stack.jsx +0 -33
- package/dist/components/layout/stack.stories.jsx +0 -40
- package/dist/components/list/index.js +0 -1
- package/dist/components/list/list.jsx +0 -52
- package/dist/components/list/list.stories.jsx +0 -135
- package/dist/components/logo/index.js +0 -1
- package/dist/components/logo/logo-type.jsx +0 -65
- package/dist/components/menu/index.js +0 -8
- package/dist/components/menu/menu-list-divider.jsx +0 -2
- package/dist/components/menu/menu-list-item-graphic.jsx +0 -2
- package/dist/components/menu/menu-list-item-meta.jsx +0 -2
- package/dist/components/menu/menu-list-item-text.jsx +0 -2
- package/dist/components/menu/menu-list-item.jsx +0 -11
- package/dist/components/menu/menu-list.jsx +0 -18
- package/dist/components/menu/menu-surface.jsx +0 -4
- package/dist/components/menu/menu.jsx +0 -2
- package/dist/components/menu/menu.stories.jsx +0 -42
- package/dist/components/modal/index.js +0 -1
- package/dist/components/modal/modal.jsx +0 -49
- package/dist/components/modal/modal.stories.jsx +0 -47
- package/dist/components/navigation/index.js +0 -1
- package/dist/components/navigation/navigation-actions.jsx +0 -8
- package/dist/components/navigation/navigation-bar.jsx +0 -42
- package/dist/components/navigation/navigation-call-to-action.jsx +0 -6
- package/dist/components/navigation/navigation-expanded.jsx +0 -165
- package/dist/components/navigation/navigation-list.jsx +0 -126
- package/dist/components/navigation/navigation-menu-control.jsx +0 -25
- package/dist/components/navigation/navigation-menu.jsx +0 -103
- package/dist/components/navigation/navigation-search-control.jsx +0 -8
- package/dist/components/navigation/navigation-search.jsx +0 -63
- package/dist/components/navigation/navigation-sign-in-control.jsx +0 -14
- package/dist/components/navigation/navigation-user-menu-items.jsx +0 -36
- package/dist/components/navigation/navigation-user-menu.jsx +0 -121
- package/dist/components/navigation/navigation.jsx +0 -137
- package/dist/components/navigation/navigation.stories.jsx +0 -260
- package/dist/components/phone-number-field/index.d.ts +0 -2
- package/dist/components/phone-number-field/index.js +0 -2
- package/dist/components/phone-number-field/phone-number-field.jsx +0 -50
- package/dist/components/phone-number-field/phone-number-field.stories.jsx +0 -23
- package/dist/components/phone-number-field/util.js +0 -19
- package/dist/components/radio/index.js +0 -2
- package/dist/components/radio/radio-group.jsx +0 -9
- package/dist/components/radio/radio-group.stories.jsx +0 -21
- package/dist/components/radio/radio.jsx +0 -31
- package/dist/components/radio/radio.stories.jsx +0 -44
- package/dist/components/select/index.js +0 -2
- package/dist/components/select/select-helper-text.jsx +0 -6
- package/dist/components/select/select.jsx +0 -152
- package/dist/components/select/select.stories.jsx +0 -40
- package/dist/components/statistics/index.js +0 -1
- package/dist/components/statistics/statistics.jsx +0 -61
- package/dist/components/statistics/statistics.stories.jsx +0 -34
- package/dist/components/switch/index.js +0 -1
- package/dist/components/switch/switch.jsx +0 -32
- package/dist/components/switch/switch.stories.jsx +0 -41
- package/dist/components/tabs/index.js +0 -1
- package/dist/components/tabs/tab-bar.jsx +0 -35
- package/dist/components/tabs/tab-text-label.jsx +0 -5
- package/dist/components/tabs/tab.jsx +0 -50
- package/dist/components/tabs/tabs.jsx +0 -65
- package/dist/components/tabs/tabs.stories.jsx +0 -27
- package/dist/components/text/index.js +0 -1
- package/dist/components/text/text.jsx +0 -138
- package/dist/components/text/text.stories.jsx +0 -262
- package/dist/components/text-field/index.js +0 -2
- package/dist/components/text-field/text-field-helper-text.jsx +0 -8
- package/dist/components/text-field/text-field.jsx +0 -124
- package/dist/components/text-field/text-field.stories.jsx +0 -32
- package/dist/components/uploader/index.js +0 -1
- package/dist/components/uploader/uploader.jsx +0 -96
- package/dist/input.d.ts +0 -1
- package/dist/input.js +0 -4
- package/dist/input.jsx +0 -4
- package/dist/theme/colors.js +0 -9
- package/dist/theme/index.js +0 -2
- package/dist/theme/mycause-theme.js +0 -33
- package/dist/theme/theme.jsx +0 -36
- package/dist/utils/browser.js +0 -19
- package/dist/utils/center-decorator.jsx +0 -15
- package/dist/utils/component-matrix.jsx +0 -39
- package/dist/utils/flags.js +0 -18
- package/dist/utils/grid-decorator.jsx +0 -27
- package/dist/utils/tap-event.js +0 -11
- package/dist/utils/wrap.js +0 -8
- /package/dist/components/{phone-number-field → phone-number-input}/util.d.ts +0 -0
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { Icon } from "../icon";
|
|
4
|
-
import IconButton from "../icon/icon-button";
|
|
5
|
-
import { BACKGROUND_GREY, ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
|
|
6
|
-
import NavigationList from "./navigation-list";
|
|
7
|
-
function NavigationExpanded({ links, children, onRequestClose, className, banner, }) {
|
|
8
|
-
return (<div className={classnames("navigation-menu", className)}>
|
|
9
|
-
<div className="content">
|
|
10
|
-
{children}
|
|
11
|
-
<div>
|
|
12
|
-
<hr />
|
|
13
|
-
</div>
|
|
14
|
-
<div className="columns">
|
|
15
|
-
<div className="navigation-list-container">
|
|
16
|
-
{links ? <NavigationList items={links}/> : null}
|
|
17
|
-
</div>
|
|
18
|
-
{banner ? <div className="banner">{banner}</div> : null}
|
|
19
|
-
</div>
|
|
20
|
-
<div className="close">
|
|
21
|
-
<IconButton className="close-button" onClick={onRequestClose}>
|
|
22
|
-
<Icon icon="close" size="100%" title="Close"/>
|
|
23
|
-
</IconButton>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<style jsx>{`
|
|
27
|
-
.navigation-menu {
|
|
28
|
-
background-color: ${BACKGROUND_GREY};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.navigation-list-container {
|
|
32
|
-
flex-grow: 1;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.content {
|
|
36
|
-
position: relative;
|
|
37
|
-
max-width: 1024px;
|
|
38
|
-
margin: 0 auto;
|
|
39
|
-
padding: 0rem 1rem 2rem 1rem;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.content > :global(*:not(:last-child)) {
|
|
43
|
-
margin-bottom: 1rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.content {
|
|
47
|
-
display: grid;
|
|
48
|
-
grid-gap: 1rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.content > :global(*:not(:last-child)) {
|
|
52
|
-
margin-bottom: initial;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.main-navigation {
|
|
56
|
-
display: flex;
|
|
57
|
-
flex-direction: column;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.main-navigation > :global(*:not(:last-child)) {
|
|
61
|
-
margin-bottom: 2rem;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.main-navigation-menus {
|
|
65
|
-
display: flex;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.main-navigation-menus > :global(*:not(:last-child)) {
|
|
69
|
-
margin-right: 4rem;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.columns {
|
|
73
|
-
display: flex;
|
|
74
|
-
padding: 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.columns > :global(*:not(:last-child)) {
|
|
78
|
-
margin-right: 8rem;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.span-2 {
|
|
82
|
-
flex-grow: 1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.columns > :global(:not:(:last-child)) {
|
|
86
|
-
margin-right: initial;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.span-2 {
|
|
90
|
-
grid-column-end: span 2;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.close {
|
|
94
|
-
display: none;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.navigation-menu :global(.close-button) {
|
|
98
|
-
padding: 6px !important;
|
|
99
|
-
font-size: 36px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.banner {
|
|
103
|
-
display: none;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
hr {
|
|
107
|
-
border: none;
|
|
108
|
-
border-top-style: solid;
|
|
109
|
-
border-top-width: 1px;
|
|
110
|
-
border-color: ${ON_BACKGROUND_GREY_GREY};
|
|
111
|
-
color: ${ON_BACKGROUND_GREY_GREY};
|
|
112
|
-
background-color: ${ON_BACKGROUND_GREY_GREY};
|
|
113
|
-
margin: 0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@media (min-width: 720px) {
|
|
117
|
-
.content {
|
|
118
|
-
padding: 2rem;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.content > :global(*:not(:last-child)) {
|
|
122
|
-
margin-bottom: 1.5rem;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.content {
|
|
126
|
-
grid-gap: 1.5rem;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.columns {
|
|
130
|
-
display: flex;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.banner {
|
|
134
|
-
display: block;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@media (min-width: 960px) {
|
|
139
|
-
.content {
|
|
140
|
-
padding: 4rem;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.content > :global(*:not(:last-child)) {
|
|
144
|
-
margin-bottom: 3rem;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.content > :global(*:not(:last-child)) {
|
|
148
|
-
margin-bottom: 0;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.content {
|
|
152
|
-
grid-gap: 3rem;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.close {
|
|
156
|
-
display: block;
|
|
157
|
-
position: absolute;
|
|
158
|
-
top: 4rem;
|
|
159
|
-
right: 4rem;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
`}</style>
|
|
163
|
-
</div>);
|
|
164
|
-
}
|
|
165
|
-
export default NavigationExpanded;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import { BRAND_DARK_GREY, INACTIVE_GREY } from "../../theme/colors";
|
|
3
|
-
import { BoldAnchor } from "../anchor/index";
|
|
4
|
-
import { Icon } from "../icon/index";
|
|
5
|
-
import { useTheme } from "../../theme/theme";
|
|
6
|
-
function NavigationList({ items, onClickItem, active, size = "normal", }) {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
return (<ul className={`size-${size}`}>
|
|
9
|
-
{items.map(item => {
|
|
10
|
-
const onClick = (e) => {
|
|
11
|
-
// href
|
|
12
|
-
if ("href" in item)
|
|
13
|
-
return;
|
|
14
|
-
e.preventDefault();
|
|
15
|
-
// combined handler
|
|
16
|
-
if (onClickItem)
|
|
17
|
-
onClickItem(item.id);
|
|
18
|
-
// individual handler
|
|
19
|
-
else if (item.onClick)
|
|
20
|
-
item.onClick();
|
|
21
|
-
};
|
|
22
|
-
const href = "href" in item ? item.href : "#";
|
|
23
|
-
const id = "id" in item ? item.id : null;
|
|
24
|
-
return (<Fragment key={"href" in item ? item.href : item.id}>
|
|
25
|
-
<li className="item">
|
|
26
|
-
<BoldAnchor analyticsId={item.analyticsId} href={href} onClick={onClick} active={id === active}>
|
|
27
|
-
{item.label}{" "}
|
|
28
|
-
{"id" in item && item.more ? (<span className="chevron">
|
|
29
|
-
<span className="chevron-right">
|
|
30
|
-
<Icon icon="chevron_right" size={size === "normal" ? "24px" : "36px"}/>
|
|
31
|
-
</span>
|
|
32
|
-
<span className="chevron-down">
|
|
33
|
-
<Icon icon="expand_more" size={size === "normal" ? "16px" : "24px"}/>
|
|
34
|
-
</span>
|
|
35
|
-
</span>) : null}
|
|
36
|
-
</BoldAnchor>
|
|
37
|
-
</li>
|
|
38
|
-
{"children" in item ? item.children : null}
|
|
39
|
-
</Fragment>);
|
|
40
|
-
})}
|
|
41
|
-
<style jsx>{`
|
|
42
|
-
ul {
|
|
43
|
-
margin: 0;
|
|
44
|
-
padding: 0;
|
|
45
|
-
list-style: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.item {
|
|
49
|
-
display: flex;
|
|
50
|
-
flex-direction: column;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
font-family: ${theme.typography.fontFamily.brand};
|
|
53
|
-
color: ${BRAND_DARK_GREY};
|
|
54
|
-
font-weight: 500;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.size-large .item {
|
|
58
|
-
font-size: 1rem;
|
|
59
|
-
height: 2.5rem;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.size-normal .item {
|
|
63
|
-
font-size: 0.875rem;
|
|
64
|
-
height: 1.75rem;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.item :global(a:focus) {
|
|
68
|
-
outline: none;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.item:focus-within {
|
|
72
|
-
outline: -webkit-focus-ring-color auto 5px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.chevron {
|
|
76
|
-
position: relative;
|
|
77
|
-
display: inline-block;
|
|
78
|
-
width: 1em;
|
|
79
|
-
height: 1em;
|
|
80
|
-
margin-left: 1rem;
|
|
81
|
-
vertical-align: middle;
|
|
82
|
-
line-height: 1;
|
|
83
|
-
transform: translateY(-5%);
|
|
84
|
-
color: ${INACTIVE_GREY};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.chevron-right {
|
|
88
|
-
display: none;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.item :global(a:hover) .chevron,
|
|
92
|
-
.item :global(a:focus) .chevron,
|
|
93
|
-
.item :global(a.active) .chevron {
|
|
94
|
-
color: inherit;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.chevron > :global(*) {
|
|
98
|
-
position: absolute;
|
|
99
|
-
top: 50%;
|
|
100
|
-
left: 50%;
|
|
101
|
-
transform: translate(-50%, -50%);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@media (min-width: 720px) {
|
|
105
|
-
.size-large .item {
|
|
106
|
-
font-size: 1.375rem;
|
|
107
|
-
min-height: 3rem;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.size-normal .item {
|
|
111
|
-
font-size: 1.125rem;
|
|
112
|
-
min-height: 2.5rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.chevron-right {
|
|
116
|
-
display: initial;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.chevron-down {
|
|
120
|
-
display: none;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
`}</style>
|
|
124
|
-
</ul>);
|
|
125
|
-
}
|
|
126
|
-
export default NavigationList;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
|
|
4
|
-
import { ToggleButton, Icon } from "../icon";
|
|
5
|
-
function NavigationMenuControl({ isMenuOpen, onChangeMenuOpen, className, ...rest }) {
|
|
6
|
-
return (<div className={classnames("menu-control", className)} {...rest}>
|
|
7
|
-
<ToggleButton active={<Icon icon="menu"/>} inactive={<Icon icon="close"></Icon>} value={isMenuOpen} onChange={onChangeMenuOpen}/>
|
|
8
|
-
<style jsx>{`
|
|
9
|
-
.menu-control {
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.menu-control::before {
|
|
15
|
-
content: "";
|
|
16
|
-
display: inline-block;
|
|
17
|
-
width: 1px;
|
|
18
|
-
height: 2rem;
|
|
19
|
-
border-left: 1px solid ${ON_BACKGROUND_GREY_GREY};
|
|
20
|
-
margin-right: calc(0.5rem - 1px);
|
|
21
|
-
}
|
|
22
|
-
`}</style>
|
|
23
|
-
</div>);
|
|
24
|
-
}
|
|
25
|
-
export default NavigationMenuControl;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Button from "../button/button";
|
|
3
|
-
import { BACKGROUND_GREY, ON_BACKGROUND_GREY_GREY } from "../../theme/colors";
|
|
4
|
-
import NavigationList from "./navigation-list";
|
|
5
|
-
export function NavigationMenu({ links, sublinks, action, active, onClickItem, }) {
|
|
6
|
-
return (<div className="navigation-menu">
|
|
7
|
-
<div className="main-navigation">
|
|
8
|
-
<div className="main-navigation-menus">
|
|
9
|
-
<NavigationList items={links.map(link => ({
|
|
10
|
-
...link,
|
|
11
|
-
children: sublinks && "id" in link && link.id === active ? (<div className="inline-submenu">
|
|
12
|
-
<NavigationList items={sublinks} active={null}/>
|
|
13
|
-
</div>) : null,
|
|
14
|
-
}))} onClickItem={onClickItem} active={active} size="large"/>
|
|
15
|
-
{sublinks ? (<div className="side-submenu">
|
|
16
|
-
<NavigationList items={sublinks} active={null}/>
|
|
17
|
-
</div>) : null}
|
|
18
|
-
</div>
|
|
19
|
-
{action ? (<div>
|
|
20
|
-
<Button display outlined color="primary" analyticsId={action.analyticsId} onClick={(e) => {
|
|
21
|
-
/**
|
|
22
|
-
* Prevent nav action button to turn into a hyperlink.
|
|
23
|
-
* This is so that google analytics will always be triggered.
|
|
24
|
-
* If we use a hyperlink instead of button clicks on the label
|
|
25
|
-
* wont be considered as a click on the hyperlink.
|
|
26
|
-
*/
|
|
27
|
-
if ("href" in action)
|
|
28
|
-
window.location.href = action.href;
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
if ("onClick" in action && action.onClick)
|
|
31
|
-
action.onClick();
|
|
32
|
-
}}>
|
|
33
|
-
{action.label}
|
|
34
|
-
</Button>
|
|
35
|
-
</div>) : null}
|
|
36
|
-
</div>
|
|
37
|
-
<style jsx>{`
|
|
38
|
-
.navigation-menu {
|
|
39
|
-
background-color: ${BACKGROUND_GREY};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.side-submenu {
|
|
43
|
-
display: none;
|
|
44
|
-
padding-left: 3rem;
|
|
45
|
-
border-left: 1px solid ${ON_BACKGROUND_GREY_GREY};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.inline-submenu {
|
|
49
|
-
padding: 0 1rem 1rem 1rem;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.content {
|
|
53
|
-
position: relative;
|
|
54
|
-
max-width: 1024px;
|
|
55
|
-
margin: 0 auto;
|
|
56
|
-
padding: 4rem;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.content > :global(*:not(:last-child)) {
|
|
60
|
-
margin-bottom: 3rem;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@supports (display: grid) {
|
|
64
|
-
.content {
|
|
65
|
-
display: grid;
|
|
66
|
-
grid-gap: 3rem;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.content > :global(*:not(:last-child)) {
|
|
70
|
-
margin-bottom: initial;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.main-navigation {
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.main-navigation > :global(*:not(:last-child)) {
|
|
80
|
-
margin-bottom: 2rem;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.main-navigation-menus {
|
|
84
|
-
display: flex;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.main-navigation-menus > :global(*:not(:last-child)) {
|
|
88
|
-
margin-right: 3rem;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@media (min-width: 720px) {
|
|
92
|
-
.side-submenu {
|
|
93
|
-
display: initial;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.inline-submenu {
|
|
97
|
-
display: none;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
`}</style>
|
|
101
|
-
</div>);
|
|
102
|
-
}
|
|
103
|
-
export default NavigationMenu;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IconButton, Icon } from "../icon";
|
|
3
|
-
function NavigationSearchControl({ onChangeSearchOpen, analyticsId, }) {
|
|
4
|
-
return (<IconButton id={analyticsId} onClick={() => onChangeSearchOpen(true)}>
|
|
5
|
-
<Icon icon="search"/>
|
|
6
|
-
</IconButton>);
|
|
7
|
-
}
|
|
8
|
-
export default NavigationSearchControl;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect } from "react";
|
|
2
|
-
import { TextField } from "../text-field";
|
|
3
|
-
import { Icon } from "../icon";
|
|
4
|
-
import { Button } from "../button";
|
|
5
|
-
import useMedia from "use-media";
|
|
6
|
-
function NavigationSearch({ value, onChange, onSubmit, onCancel, }) {
|
|
7
|
-
// Focus the search bar when opened
|
|
8
|
-
const input = useRef(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (input.current) {
|
|
11
|
-
input.current.focus();
|
|
12
|
-
}
|
|
13
|
-
}, [input]);
|
|
14
|
-
const handleKeyDown = (e) => {
|
|
15
|
-
if (e.key === "Enter") {
|
|
16
|
-
e.preventDefault();
|
|
17
|
-
onSubmit();
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const handleChange = (e) => {
|
|
21
|
-
onChange(e.currentTarget.value);
|
|
22
|
-
};
|
|
23
|
-
const placeholder = "Try searching for a friend, campaign, or event";
|
|
24
|
-
const isMobile = useMedia("screen and (max-width: 719px)");
|
|
25
|
-
const isCompact = useMedia("screen and (max-width: 959px)");
|
|
26
|
-
return (<>
|
|
27
|
-
<div className="navigation-search">
|
|
28
|
-
{!isCompact ? (<TextField leadingIcon={<Icon icon="search"/>} trailingIcon={<Icon icon="close" title="close"/>} onTrailingIconSelect={() => onCancel()} onChange={handleChange} onKeyDown={handleKeyDown} value={value} placeholder={placeholder} ref={input} large/>) : (<>
|
|
29
|
-
<TextField leadingIcon={<Icon icon="search"/>} trailingIcon={value ? <Icon icon="cancel" title="clear"/> : undefined} onTrailingIconSelect={() => onChange("")} onChange={(e) => onChange(e.currentTarget.value)} onKeyDown={handleKeyDown} value={value} placeholder={!isMobile ? placeholder : "Search"} ref={input}/>
|
|
30
|
-
<div className="cancel">
|
|
31
|
-
<Button onClick={() => onCancel()}>Cancel</Button>
|
|
32
|
-
</div>
|
|
33
|
-
</>)}
|
|
34
|
-
</div>
|
|
35
|
-
<style jsx>{`
|
|
36
|
-
.navigation-search {
|
|
37
|
-
height: 100%;
|
|
38
|
-
width: 100%;
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.navigation-search > :global(*:first-child) {
|
|
44
|
-
flex-grow: 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.cancel {
|
|
48
|
-
margin-left: 0.5rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.cancel :global(.button) {
|
|
52
|
-
height: 3.5rem;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@media (min-width: 720px) {
|
|
56
|
-
.navigation-search {
|
|
57
|
-
padding: 0 1rem;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
`}</style>
|
|
61
|
-
</>);
|
|
62
|
-
}
|
|
63
|
-
export default NavigationSearch;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { Button } from "../button";
|
|
4
|
-
import { IconButton, Icon } from "../icon";
|
|
5
|
-
function NavigationSignInControl({ analyticsId, onRequestSignIn, compact, className, ...rest }) {
|
|
6
|
-
return (<div className={classnames("sign-in-control", className)} {...rest}>
|
|
7
|
-
{!compact ? (<Button analyticsId={analyticsId} className="sign-in-button" color="neutral" icon={<Icon icon="perm_identity" color="accent"/>} onClick={() => onRequestSignIn()} display>
|
|
8
|
-
Login
|
|
9
|
-
</Button>) : (<IconButton id={analyticsId} title="Sign in" color="accent" onClick={() => onRequestSignIn()}>
|
|
10
|
-
<Icon icon="perm_identity"/>
|
|
11
|
-
</IconButton>)}
|
|
12
|
-
</div>);
|
|
13
|
-
}
|
|
14
|
-
export default NavigationSignInControl;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, { Fragment, useState } from "react";
|
|
2
|
-
import Icon from "../icon/icon";
|
|
3
|
-
import { MenuListItem, MenuListItemText, MenuListItemGraphic, MenuListItemMeta, } from "../menu";
|
|
4
|
-
function NavigationUserMenuItem({ icon, label, onClick, submenu, isSubmenuOpen, ...rest }) {
|
|
5
|
-
return (<Fragment>
|
|
6
|
-
<MenuListItem onClick={onClick} {...rest}>
|
|
7
|
-
<MenuListItemGraphic graphic={<Icon color="primary" {...icon}/>}/>
|
|
8
|
-
<MenuListItemText primaryText={label}/>
|
|
9
|
-
{submenu ? (<MenuListItemMeta meta={<Icon color="primary" icon={isSubmenuOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}/>}/>) : null}
|
|
10
|
-
</MenuListItem>
|
|
11
|
-
{submenu && isSubmenuOpen
|
|
12
|
-
? submenu.map(subItem => (<MenuListItem key={subItem.id || subItem.href} {...subItem}>
|
|
13
|
-
<MenuListItemText primaryText={subItem.label} className="icon-submenu"/>
|
|
14
|
-
</MenuListItem>))
|
|
15
|
-
: null}
|
|
16
|
-
</Fragment>);
|
|
17
|
-
}
|
|
18
|
-
function NavigationUserMenuItems({ items }) {
|
|
19
|
-
// To keep track of which submenu (if any) is open at any time
|
|
20
|
-
// There can be only one open at a time
|
|
21
|
-
const [activeSubmenu, setActiveSubmenu] = useState(-1);
|
|
22
|
-
const handleClick = (index, item) => {
|
|
23
|
-
if (item.submenu) {
|
|
24
|
-
setActiveSubmenu(activeSubmenu === index ? -1 : index);
|
|
25
|
-
}
|
|
26
|
-
else if (item.onClick) {
|
|
27
|
-
item.onClick();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return (<Fragment>
|
|
31
|
-
{items.map((item, i) => {
|
|
32
|
-
return (<NavigationUserMenuItem key={item.id || item.href || i} id={item.id || item.href} isSubmenuOpen={item.submenu && activeSubmenu === i} {...item} onClick={() => handleClick(i, item)}/>);
|
|
33
|
-
})}
|
|
34
|
-
</Fragment>);
|
|
35
|
-
}
|
|
36
|
-
export default NavigationUserMenuItems;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import useMedia from "use-media";
|
|
4
|
-
import Avatar from "../avatar/avatar";
|
|
5
|
-
import { useTheme } from "../../theme/theme";
|
|
6
|
-
import { MenuList, MenuListItem, MenuListItemText } from "../menu";
|
|
7
|
-
import NavigationUserMenuItems from "./navigation-user-menu-items";
|
|
8
|
-
function NavigationUserMenu({ user, items, isOpen, onChangeOpen, }) {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
// Allow users with pointing devices to open/close the menu by hovering in/out
|
|
11
|
-
const [isHovered, bind] = useHover();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
onChangeOpen(isHovered);
|
|
14
|
-
}, [onChangeOpen, isHovered]);
|
|
15
|
-
return (<div className={classnames("menu-anchor", {
|
|
16
|
-
compact: useMedia("screen and (max-width: 425px)"),
|
|
17
|
-
})} {...bind()}>
|
|
18
|
-
<div className={classnames("menu-trigger", { open: isOpen })}>
|
|
19
|
-
<Avatar name={user.name} src={user.avatar ? user.avatar.src : undefined} onClick={() => onChangeOpen(!isOpen)}/>
|
|
20
|
-
</div>
|
|
21
|
-
{items && isOpen && (<div className="user-menu">
|
|
22
|
-
<MenuList>
|
|
23
|
-
<MenuListItem>
|
|
24
|
-
<MenuListItemText primaryText={<strong>Hello {user.name}!</strong>}/>
|
|
25
|
-
</MenuListItem>
|
|
26
|
-
<NavigationUserMenuItems items={items}/>
|
|
27
|
-
</MenuList>
|
|
28
|
-
</div>)}
|
|
29
|
-
<style jsx>{`
|
|
30
|
-
.menu-trigger {
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
width: 3rem;
|
|
33
|
-
height: 3rem;
|
|
34
|
-
display: flex;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
align-items: center;
|
|
37
|
-
border-radius: 0.25rem;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.open {
|
|
41
|
-
background-color: #efefef;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.menu-anchor {
|
|
45
|
-
position: relative;
|
|
46
|
-
overflow: visible;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.menu-anchor.compact {
|
|
50
|
-
position: initial;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.user-menu {
|
|
54
|
-
position: absolute;
|
|
55
|
-
z-index: 1;
|
|
56
|
-
top: 100%;
|
|
57
|
-
right: 0;
|
|
58
|
-
background-color: white;
|
|
59
|
-
border-radius: 0.25rem;
|
|
60
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12),
|
|
61
|
-
0 1px 4px rgba(0, 0, 0, 0.24);
|
|
62
|
-
overflow-x: scroll;
|
|
63
|
-
max-height: calc(100vh - 64px);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* arrow */
|
|
67
|
-
.user-menu::before {
|
|
68
|
-
display: block;
|
|
69
|
-
content: "";
|
|
70
|
-
width: 0;
|
|
71
|
-
height: 0;
|
|
72
|
-
border-left: 8px solid transparent;
|
|
73
|
-
border-right: 8px solid transparent;
|
|
74
|
-
border-bottom: 8px solid white;
|
|
75
|
-
position: absolute;
|
|
76
|
-
top: -8px;
|
|
77
|
-
right: calc((3rem / 2) - 8px);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.compact .user-menu {
|
|
81
|
-
left: 8px;
|
|
82
|
-
right: 8px;
|
|
83
|
-
top: 3.5rem;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.compact .user-menu::before {
|
|
87
|
-
right: calc((3rem / 2) - 8px + 4.5rem);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.user-menu :global(.mdc-list-item__graphic) {
|
|
91
|
-
margin-right: 1rem;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.user-menu :global(.mdc-list-item:not(:last-of-type)) {
|
|
95
|
-
border-bottom: 1px solid #e0e0e0;
|
|
96
|
-
}
|
|
97
|
-
`}</style>
|
|
98
|
-
<style jsx>{`
|
|
99
|
-
.user-menu :global(.mdc-list) {
|
|
100
|
-
font-family: ${theme.typography.fontFamily.brand};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
strong {
|
|
104
|
-
color: ${theme.color.foreground.primary};
|
|
105
|
-
}
|
|
106
|
-
`}</style>
|
|
107
|
-
</div>);
|
|
108
|
-
}
|
|
109
|
-
export default NavigationUserMenu;
|
|
110
|
-
function useHover() {
|
|
111
|
-
const [isHovered, setIsHovered] = useState();
|
|
112
|
-
const bind = () => ({
|
|
113
|
-
onMouseOver: () => {
|
|
114
|
-
setIsHovered(true);
|
|
115
|
-
},
|
|
116
|
-
onMouseLeave: () => {
|
|
117
|
-
setIsHovered(false);
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
return [isHovered, bind];
|
|
121
|
-
}
|