Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 redirect #1138

Merged
merged 11 commits into from
Feb 13, 2024
Merged
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
34 changes: 32 additions & 2 deletions js/hubs/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ const { getImageFromCDN, loader } = imageManager
const navData = [
{
label: '+ Publish',
href: '/dashboard?action=publishRelease',
href: 'https://www.ninaprotocol.com',
},
{
label: 'Dashboard',
@@ -173,6 +173,19 @@ const NavBar = ({ hubPubkey }) => {
</LogoLinkWrapper>
</a>
</Link>
<Redirect>
{' '}
This domain is no longer being maintained. Please visit{' '}
<BlueTypography style={{ margin: '0 4px' }}>
<Link href="https://ninaprotocol.com">
<a target="_blank" style={{ fontWeight: 'bold' }}>
{' '}
ninaprotocol.com{' '}
</a>
</Link>
</BlueTypography>
to upload music or access your hubs.
</Redirect>
<CtaWrapper>
{!mobileView && canAddContent && getMenuButtons(hubData?.handle)}
{!wallet?.connected && (
@@ -269,7 +282,7 @@ const NavBar = ({ hubPubkey }) => {
return (
<List>
{navData.map(({ label, href }) => {
href = `/${hubHandle}${href}`
href = label === 'Dashboard' ? `/${hubHandle}${href}` : href
return (
<Link
key={label}
@@ -328,6 +341,13 @@ const LogoLinkWrapper = styled('a')(({ theme }) => ({
},
}))

const BlueTypography = styled(Typography)(({ theme }) => ({
'& a': {
color: theme.palette.blue,
textDecoration: 'none',
},
}))

const NavCtas = styled('div')(() => ({
display: 'flex',
}))
@@ -359,6 +379,16 @@ const CtaWrapper = styled(Box)(({ theme }) => ({
alignItems: 'center',
}))

const Redirect = styled(Typography)(({ theme }) => ({
display: 'flex',
alignItems: 'center',
cursor: 'default !important',
fontWeight: 'bold',
[theme.breakpoints.down('md')]: {
display: 'none',
},
}))

const StyledAppBar = styled(AppBar)(({ theme }) => ({
backgroundColor: theme.palette.background.default,
color: 'black',
24 changes: 12 additions & 12 deletions js/hubs/next.config.js
Original file line number Diff line number Diff line change
@@ -11,17 +11,17 @@ const withTM = require('next-transpile-modules')([
'@solana/wallet-adapter-sollet',
]) // pass the modules you would like to see transpiled

const { withSentryConfig } = require('@sentry/nextjs')
const sentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
}
// const { withSentryConfig } = require('@sentry/nextjs')
// const sentryWebpackPluginOptions = {
// // Additional config options for the Sentry Webpack plugin. Keep in mind that
// // the following options are set automatically, and overriding them is not
// // recommended:
// // release, url, org, project, authToken, configFile, stripPrefix,
// // urlPrefix, include, ignore
// silent: true, // Suppresses all logs
// // For all available options, see:
// // https://github.com/getsentry/sentry-webpack-plugin#options.
// }

const cluster = process.env.SOLANA_CLUSTER
const IMGIX_URL = cluster === 'devnet' ? 'nina-dev.imgix.net' : 'nina.imgix.net'
@@ -91,4 +91,4 @@ const moduleExports = withTM({
},
})

module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions)
module.exports = moduleExports
40 changes: 24 additions & 16 deletions js/hubs/pages/[hubPubkey]/releases/[hubReleasePubkey]/index.js
Original file line number Diff line number Diff line change
@@ -62,23 +62,31 @@ export default ReleasePage
export const getStaticPaths = async () => {
await initSdkIfNeeded(true)
const paths = []
const { hubs } = await NinaSdk.Hub.fetchAll({ limit: 1000 })
for await (const hub of hubs) {
const { releases } = await NinaSdk.Hub.fetchReleases(hub.publicKey)
releases.forEach((release) => {
paths.push({
params: {
hubPubkey: hub.publicKey,
hubReleasePubkey: release.hubReleasePublicKey,
},
})
paths.push({
params: {
hubPubkey: hub.handle,
hubReleasePubkey: release.hubReleasePublicKey,
},
})
try {
const { hubs } = await NinaSdk.Hub.fetchAll({
limit: 10,
offset: 0,
sort: 'desc',
})
for await (const hub of hubs) {
const { releases } = await NinaSdk.Hub.fetchReleases(hub.publicKey)
releases.forEach((release) => {
paths.push({
params: {
hubPubkey: hub.publicKey,
hubReleasePubkey: release.hubReleasePublicKey,
},
})
paths.push({
params: {
hubPubkey: hub.handle,
hubReleasePubkey: release.hubReleasePublicKey,
},
})
})
}
} catch (error) {
console.warn(error)
}
return {
paths,