Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions apps/studio/src/pages/createProfile/CreateProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { FunctionComponent, useMemo } from "react";
import { useLocation } from "react-router-dom";

import { useFlags } from "launchdarkly-react-client-sdk";

import * as Yup from "yup";

import { Box, Container, useTheme } from "@mui/material";

import { WizardForm } from "@newm-web/elements";
import * as Yup from "yup";
import { getUpdatedValues, removeTrailingSlash } from "@newm-web/utils";
import { useLocation } from "react-router-dom";

import Begin from "./Begin";
import SelectNickname from "./SelectNickname";
import SelectRole from "./SelectRole";
Expand All @@ -13,7 +19,7 @@ import AddLastName from "./AddLastName";
import SelectLocation from "./SelectLocation";
import NotFoundPage from "../NotFoundPage";
import { useGetRolesQuery } from "../../modules/content";
import { commonYupValidation } from "../../common";
import { commonYupValidation, useBreakpoint } from "../../common";
import {
ProfileFormValues,
emptyProfile,
Expand All @@ -24,7 +30,11 @@ import {
const rootPath = "create-profile";

const CreateProfile: FunctionComponent = () => {
const { webStudioDisableDistributionAndSales } = useFlags();

const theme = useTheme();
const { isDesktop } = useBreakpoint();

const currentPathLocation = useLocation();

const { data: roles = [] } = useGetRolesQuery();
Expand Down Expand Up @@ -127,6 +137,7 @@ const CreateProfile: FunctionComponent = () => {
display: "flex",
flex: 1,
maxWidth: "100%",
mt: webStudioDisableDistributionAndSales && isDesktop ? 4 : 0,
pt: 7.5,
px: 2,
textAlign: "center",
Expand Down
11 changes: 10 additions & 1 deletion apps/studio/src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,16 @@ const Home: FunctionComponent = () => {
path=""
/>

<Route element={ <UploadSong /> } path="upload-song/*" />
<Route
element={
webStudioDisableDistributionAndSales ? (
<Navigate to="/home/releases" replace />
) : (
<UploadSong />
)
}
path="upload-song/*"
/>

<Route
element={
Expand Down
62 changes: 42 additions & 20 deletions apps/studio/src/pages/home/releases/Discography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ import { FunctionComponent, useState } from "react";

import { Box, Typography } from "@mui/material";

import { GradientDashedOutline, IconMessage, Link } from "@newm-web/elements";
import { AddSong } from "@newm-web/assets";

import { useFlags } from "launchdarkly-react-client-sdk";

import {
GradientDashedOutline,
IconMessage,
Link,
Tooltip,
} from "@newm-web/elements";
import { AddSong } from "@newm-web/assets";

import SongList from "./SongList";
import OfficialStatementCTA from "../../../components/OfficialStatementCTA";
import { SearchBox } from "../../../components";
import { useGetSongCountQuery } from "../../../modules/song";

const Discography: FunctionComponent = () => {
// TODO(webStudioAlbumPhaseTwo): Remove flag once flag is retired.
const { webStudioAlbumPhaseTwo } = useFlags();
const { webStudioAlbumPhaseTwo, webStudioDisableDistributionAndSales } =
useFlags();

const [query, setQuery] = useState("");

Expand All @@ -33,23 +40,38 @@ const Discography: FunctionComponent = () => {
</Typography>

<Box sx={ { mb: 5.5 } }>
<Link
aria-label="Create New Release"
sx={ {
textDecoration: "none",
} }
to={
webStudioAlbumPhaseTwo ? "/home/releases/new" : "/home/upload-song"
}
>
<GradientDashedOutline
sx={ {
padding: 3,
} }
{ webStudioDisableDistributionAndSales ? (
<Tooltip title={ <OfficialStatementCTA /> }>
<Box
aria-disabled="true"
aria-label="Create New Release"
component="span"
role="button"
sx={ {
cursor: "not-allowed",
textDecoration: "none",
} }
>
<GradientDashedOutline sx={ { padding: 3 } }>
<IconMessage icon={ <AddSong /> } message="Create New Release" />
</GradientDashedOutline>
</Box>
Comment on lines 44 to 58
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disabled "Create New Release" button implementation may have an accessibility issue. When using a Box with cursor: not-allowed instead of a disabled button, screen readers may not announce that the element is disabled. Consider using an aria-disabled="true" attribute on the Box, or adding role="button" along with aria-disabled="true" to ensure assistive technologies properly communicate the disabled state to users. Also note that MUI Tooltip may not show on keyboard focus for non-interactive elements, so keyboard users might not see the explanation.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outdated.

</Tooltip>
) : (
<Link
aria-label="Create New Release"
sx={ { textDecoration: "none" } }
to={
webStudioAlbumPhaseTwo
? "/home/releases/new"
: "/home/upload-song"
}
>
<IconMessage icon={ <AddSong /> } message="Create New Release" />
</GradientDashedOutline>
</Link>
<GradientDashedOutline sx={ { padding: 3 } }>
<IconMessage icon={ <AddSong /> } message="Create New Release" />
</GradientDashedOutline>
</Link>
) }
</Box>

{ totalCountOfSongs || query ? (
Expand Down
41 changes: 36 additions & 5 deletions apps/studio/src/pages/home/releases/Releases.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FunctionComponent } from "react";
import { Route, Routes } from "react-router-dom";
import { Navigate, Route, Routes } from "react-router-dom";

import { useFlags } from "launchdarkly-react-client-sdk";

Expand All @@ -16,7 +16,9 @@ import NotFoundPage from "../../NotFoundPage";

const Releases: FunctionComponent = () => {
// TODO(webStudioAlbumPhaseTwo): Remove flag once flag is retired.
const { webStudioAlbumPhaseTwo } = useFlags();
// TODO(webStudioDisableDistributionAndSales): Remove once flag is retired.
const { webStudioAlbumPhaseTwo, webStudioDisableDistributionAndSales } =
useFlags();

return (
<Container
Expand All @@ -40,11 +42,40 @@ const Releases: FunctionComponent = () => {

{ webStudioAlbumPhaseTwo && (
<>
<Route element={ <ReleaseDetails /> } path="new/*" />
<Route
element={
webStudioDisableDistributionAndSales ? (
<Navigate to="/home/releases" replace />
) : (
<ReleaseDetails />
)
}
path="new/*"
/>
<Route element={ <ReleaseDetails /> } path=":releaseId/*" />

<Route element={ <NewTrack /> } path="new/track/new" />
<Route element={ <NewTrack /> } path=":releaseId/track/new" />
<Route
element={
webStudioDisableDistributionAndSales ? (
<Navigate to="/home/releases" replace />
) : (
<NewTrack />
)
}
path="new/track/new"
/>

<Route
element={
webStudioDisableDistributionAndSales ? (
<Navigate to="/home/releases" replace />
) : (
<NewTrack />
)
}
path=":releaseId/track/new"
/>

<Route
element={ <TrackDetailsRouter /> }
path=":releaseId/track/:trackId"
Expand Down
Loading