Skip to content

Adding the Sunny Awards #10

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
39 changes: 37 additions & 2 deletions config/features.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import colors from 'tailwindcss/colors';
import {
base,
mainnet,
optimism,
optimismSepolia,
Expand All @@ -8,15 +9,21 @@ import {
zksyncSepoliaTestnet,
} from 'wagmi/chains';

type WHITELABEL_ENV = 'OPTIMISM' | 'ZK_SYNC';
type WHITELABEL_ENV = 'OPTIMISM' | 'ZK_SYNC' | 'SUNNY';

const _WHITELABEL_ENV = process.env.NEXT_PUBLIC_WHITELABEL_ENV;

if (!_WHITELABEL_ENV) {
throw new Error('NEXT_PUBLIC_WHITELABEL_ENV is not set');
}

if (!(_WHITELABEL_ENV === 'OPTIMISM' || _WHITELABEL_ENV === 'ZK_SYNC')) {
if (
!(
_WHITELABEL_ENV === 'OPTIMISM' ||
_WHITELABEL_ENV === 'ZK_SYNC' ||
_WHITELABEL_ENV === 'SUNNY'
)
) {
throw new Error('NEXT_PUBLIC_WHITELABEL_ENV is not set to a valid value');
}

Expand Down Expand Up @@ -75,6 +82,23 @@ const featureMatrix: Record<WHITELABEL_ENV, Features> = {
CONFIRMATION_SECOND_BUTTON_LINK: '',
CLAIM_FEE: true,
},
SUNNY: {
APP_NAME: 'The Sunny Awards',
BG_IMAGE: {
src: '',
},
DELEGATION_REQUIRED: false,
DELEGATION_ENABLED: false,
DELEGATES_URL: 'https://vote.zknation.io/dao/delegates',
CONFIRMATION_CHECKMARK_BG_COLOR: 'black',
INTRO_TEXT:
'Celebrate onchain Summer 2024 and explore the grants from the Sunny Awards. For grantees, this claiming tool offers a self-serve interface to claim your grant.',
ONLY_SHOW_CLAIMABLE: false,
CONFIRMATION_SUBHEADER: '',
CONFIRMATION_SECOND_BUTTON_TEXT: '',
CONFIRMATION_SECOND_BUTTON_LINK: '',
CLAIM_FEE: true,
},
};

export const FEATURES = featureMatrix[_WHITELABEL_ENV];
Expand All @@ -97,6 +121,11 @@ export const getChainConfig = () => {
appName: 'ZKsync Claim Tool',
chains: [mainnet, zksync, zksyncSepoliaTestnet],
};
case 'SUNNY':
return {
appName: 'Sunny Claim Tool',
chains: [mainnet, optimism, optimismSepolia, sepolia],
};
}
};

Expand All @@ -120,5 +149,11 @@ export const getWhitelabelThemeColors = (): WhitelabelThemeColors => {
primaryAction: colors.blue[500],
primaryActionButtonBg: colors.blue[900],
};
case 'SUNNY':
return {
bgClaimcardHeader: colors.blue[200],
primaryAction: colors.blue[500],
primaryActionButtonBg: colors.blue[900],
};
}
};
Binary file added public/sunny-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/common/images/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import Image from 'next/image';
import { WHITELABEL_ENV } from '../../../../config/features';
import OpLogo from '../../../../public/op-logo.svg';
import SunnyLogo from '../../../../public/sunny-logo.png';
import ZkSyncLogo from '../../../../public/zksync_logo_dark.svg';

const Logo = () => {
switch (WHITELABEL_ENV) {
case 'OPTIMISM':
return <Image src={OpLogo} alt="OP Logo" />;
case 'ZK_SYNC':
return <Image src={ZkSyncLogo} alt="ZKSync Logo" height={40} />;
case 'SUNNY':
return <Image src={SunnyLogo} alt="Sunny Logo" height={40} />;
default:
throw new Error('Invalid WHITE_LABEL_ENV');
}
Expand Down