Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-2680] Attribution Modal (#3778)
Browse files Browse the repository at this point in the history
  • Loading branch information
amendelsohn authored and dharit-tan committed Jul 24, 2023
1 parent bbbd666 commit 338e313
Show file tree
Hide file tree
Showing 22 changed files with 485 additions and 46 deletions.
6 changes: 3 additions & 3 deletions packages/common/src/hooks/usePremiumContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { useMemo } from 'react'

import { useSelector } from 'react-redux'

import { Chain } from 'models/Chain'
import { ID } from 'models/Identifiers'
import {
Chain,
ID,
PremiumConditions,
Track,
isPremiumContentCollectibleGated,
isPremiumContentFollowGated,
isPremiumContentTipGated
} from 'models'
} from 'models/Track'
import { getAccountUser } from 'store/account/selectors'
import { cacheTracksSelectors, cacheUsersSelectors } from 'store/cache'
import { premiumContentSelectors } from 'store/premium-content'
Expand Down
19 changes: 8 additions & 11 deletions packages/common/src/store/notifications/types.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { EntityState, PayloadAction } from '@reduxjs/toolkit'

import { ChallengeRewardID } from 'models/AudioRewards'
import { BadgeTier } from 'models/BadgeTier'
import { Collection } from 'models/Collection'
import { ID } from 'models/Identifiers'
import { Status } from 'models/Status'
import { Track } from 'models/Track'
import { User } from 'models/User'
import { StringWei } from 'models/Wallet'
import { Nullable } from 'utils'

import {
ID,
ChallengeRewardID,
BadgeTier,
Collection,
Status,
Track,
User,
StringWei
} from '../../models'

export enum NotificationType {
Announcement = 'Announcement',
UserSubscription = 'UserSubscription',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { computeLicenseIcons } from '../utils/computeLicenseIcons'

const messages = {
licenseType: 'License Type',
noLicense: 'All rights reserved'
noLicense: 'All Rights Reserved'
}

const useStyles = makeStyles(({ spacing }) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.tab {
z-index: 3;
flex: 1 1 auto;
padding: var(--unit-2) var(--unit-3);
padding: var(--unit-2);
border-radius: 4px;
cursor: pointer;
user-select: none;
Expand All @@ -21,6 +21,7 @@
font-size: 15px;
font-weight: var(--font-demi-bold);
position: relative;
text-align: center;
}

.tab.isMobile {
Expand Down Expand Up @@ -68,3 +69,7 @@
flex: 1;
text-align: center;
}

.disabled {
opacity: 0.5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export const SegmentedControl = <T extends string>(
<div
className={cn(styles.tabs, props.className, {
[styles.containerFullWidth]: !!props.fullWidth,
[styles.isMobile]: props.isMobile
[styles.isMobile]: props.isMobile,
[styles.disabled]: props.disabled
})}
>
<animated.div
Expand Down Expand Up @@ -94,6 +95,7 @@ export const SegmentedControl = <T extends string>(
onChange={() => {
onSetSelected(option.key)
}}
disabled={props.disabled}
/>
{option.text}
</label>
Expand Down
2 changes: 2 additions & 0 deletions packages/stems/src/components/SegmentedControl/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export type SegmentedControlProps<T extends string> = {

fullWidth?: boolean

disabled?: boolean

isMobile?: boolean

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/assets/img/creativeCommons/by.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web/src/assets/img/creativeCommons/cc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web/src/assets/img/creativeCommons/nc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web/src/assets/img/creativeCommons/nd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web/src/assets/img/creativeCommons/sa.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/web/src/assets/img/iconCreativeCommons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions packages/web/src/components/layout/layout.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.row {
display: flex;
flex-direction: row;
align-items: center;
}

.col {
display: flex;
flex-direction: column;
}

.gap1 {
gap: var(--unit-1);
}

.gap2 {
gap: var(--unit-2);
}

.gap4 {
gap: var(--unit-4);
}

.gap6 {
gap: var(--unit-6);
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AttributionModalForm } from '../forms/AttributionModalForm'
import { ReleaseDateModalForm } from '../forms/ReleaseDateModalForm'
import { RemixModalForm } from '../forms/RemixModalForm'
import { SourceFilesModalForm } from '../forms/SourceFilesModalForm'
Expand All @@ -12,6 +13,7 @@ export const TrackModalArray = () => {
<RemixModalForm />
<SourceFilesModalForm />
<TrackAvailabilityModalForm />
<AttributionModalForm />
</div>
)
}
10 changes: 10 additions & 0 deletions packages/web/src/pages/upload-page/fields/ModalField.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
}

/* Modal styles */
.root {
width: 720px;
}

.modalHeader {
display: flex;
flex-direction: row;
Expand All @@ -21,6 +25,9 @@
}

.modalTitle {
display: flex;
flex-direction: row;
align-items: center;
font-weight: var(--font-heavy);
font-size: var(--font-xl);
line-height: 25px;
Expand All @@ -33,6 +40,9 @@

.modalTitle :global(*) {
color: var(--neutral-light-2);
display: flex;
flex-direction: row;
align-items: center;
}

.caret {
Expand Down
46 changes: 20 additions & 26 deletions packages/web/src/pages/upload-page/fields/ModalField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useFormikContext } from 'formik'
import styles from './ModalField.module.css'

const messages = {
done: 'Done'
save: 'Save'
}

type ModalFieldProps = PropsWithChildren & {
Expand All @@ -37,31 +37,25 @@ export const ModalField = (props: ModalFieldProps) => {
}

const modal = (
<div className={styles.modal}>
<Modal onClose={cancel} isOpen={isModalOpen}>
<ModalHeader>
<div className={styles.modalHeader}>
<ModalTitle
className={styles.modalTitle}
title={title}
icon={icon}
/>
</div>
</ModalHeader>
<ModalContent>{children}</ModalContent>
<ModalFooter>
<Button
type={ButtonType.PRIMARY}
text={messages.done}
onClick={() => {
submitForm()
close()
}}
buttonType='submit'
/>
</ModalFooter>
</Modal>
</div>
<Modal onClose={cancel} isOpen={isModalOpen} bodyClassName={styles.root}>
<ModalHeader>
<div className={styles.modalHeader}>
<ModalTitle className={styles.modalTitle} title={title} icon={icon} />
</div>
</ModalHeader>
<ModalContent>{children}</ModalContent>
<ModalFooter>
<Button
type={ButtonType.PRIMARY}
text={messages.save}
onClick={() => {
submitForm()
close()
}}
buttonType='submit'
/>
</ModalFooter>
</Modal>
)

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.attributionCommercialRow {
display: flex;
flex-direction: row;
justify-content: space-between;
gap: var(--unit-3);
}

.attributionRowItem {
flex-grow: 1;
}

.verticalDivider {
height: auto;
}

.disabled {
opacity: 0.5;
}

.license {
display: flex;
flex-direction: column;
gap: var(--unit-2);
padding: var(--unit-4);
border-radius: 8px;
border: 1px solid var(--neutral-light-8);
background: var(--neutral-light-10);
text-transform: capitalize;
}

.licenseIcons {
gap: 6px;
}
Loading

0 comments on commit 338e313

Please sign in to comment.