|
| 1 | +import { globalColors } from '@/design-system/color/palettes'; |
| 2 | +import type { Tier, TierId } from '@/features/rnbw-membership/types'; |
| 3 | +import { opacity } from '@/framework/ui/utils/opacity'; |
| 4 | +import type { LinearGradientProps } from 'expo-linear-gradient'; |
| 5 | + |
| 6 | +type Themed<T> = { light: T; dark: T }; |
| 7 | + |
| 8 | +type ShadowConfig = { |
| 9 | + shadowColor: string; |
| 10 | + shadowOffset: { width: number; height: number }; |
| 11 | + shadowOpacity: number; |
| 12 | + shadowRadius: number; |
| 13 | +}; |
| 14 | + |
| 15 | +type GradientConfig = { |
| 16 | + colors: LinearGradientProps['colors']; |
| 17 | + locations?: LinearGradientProps['locations']; |
| 18 | + start?: { x: number; y: number }; |
| 19 | + end?: { x: number; y: number }; |
| 20 | +}; |
| 21 | + |
| 22 | +type TextShadowConfig = { |
| 23 | + textShadowColor: string; |
| 24 | + textShadowOffset: { width: number; height: number }; |
| 25 | + textShadowRadius: number; |
| 26 | +}; |
| 27 | + |
| 28 | +type TierVisuals = { |
| 29 | + backgroundGradient: Themed<GradientConfig>; |
| 30 | + textGradient: Themed<GradientConfig>; |
| 31 | + badgeTextGradient: Themed<GradientConfig>; |
| 32 | + badgeGradient: Themed<GradientConfig>; |
| 33 | + badgeBorderGradient: Themed<GradientConfig>; |
| 34 | + badgeShadow: Themed<ShadowConfig>; |
| 35 | + badgeTextShadow: Themed<TextShadowConfig>; |
| 36 | +}; |
| 37 | + |
| 38 | +export const TIER_VISUALS: Record<TierId, TierVisuals> = { |
| 39 | + STAKING_TIER_LEVEL_BASIC: { |
| 40 | + backgroundGradient: { |
| 41 | + light: { colors: [opacity('#0086FF', 0.4), opacity('#0086FF', 0)] }, |
| 42 | + dark: { colors: [opacity('#0086FF', 0.16), opacity('#0086FF', 0)] }, |
| 43 | + }, |
| 44 | + textGradient: { light: { colors: ['#000000', '#000000'] }, dark: { colors: ['#FFFFFF', '#FFFFFF'] } }, |
| 45 | + badgeTextGradient: { light: { colors: ['#FFFFFF', '#FFFFFF'] }, dark: { colors: ['#FFFFFF', '#FFFFFF'] } }, |
| 46 | + badgeGradient: { light: { colors: ['#2B80F4', '#1661C9'] }, dark: { colors: ['#2B80F4', '#1661C9'] } }, |
| 47 | + badgeBorderGradient: { |
| 48 | + light: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 49 | + dark: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 50 | + }, |
| 51 | + badgeShadow: { |
| 52 | + light: { shadowColor: '#000000', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.1, shadowRadius: 9 }, |
| 53 | + dark: { shadowColor: '#000000', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.1, shadowRadius: 9 }, |
| 54 | + }, |
| 55 | + badgeTextShadow: { |
| 56 | + light: { textShadowColor: 'rgba(0, 0, 0, 0.14)', textShadowOffset: { width: 0, height: 1 }, textShadowRadius: 1 }, |
| 57 | + dark: { textShadowColor: 'rgba(0, 0, 0, 0.14)', textShadowOffset: { width: 0, height: 1 }, textShadowRadius: 1 }, |
| 58 | + }, |
| 59 | + }, |
| 60 | + STAKING_TIER_LEVEL_SILVER: { |
| 61 | + backgroundGradient: { |
| 62 | + light: { colors: [opacity('#E6E6E6', 0.4), opacity('#E6E6E6', 0)] }, |
| 63 | + dark: { colors: [opacity('#CFCFCF', 0.16), opacity('#CFCFCF', 0)] }, |
| 64 | + }, |
| 65 | + textGradient: { light: { colors: ['#313131', '#888888'] }, dark: { colors: ['#313131', '#888888'] } }, |
| 66 | + badgeTextGradient: { light: { colors: ['#313131', '#888888'] }, dark: { colors: ['#111111', '#585858'] } }, |
| 67 | + badgeGradient: { light: { colors: ['#EFEFEF', '#CDCDCD'] }, dark: { colors: ['#D6D6D6', '#828282'] } }, |
| 68 | + badgeBorderGradient: { |
| 69 | + light: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 70 | + dark: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 71 | + }, |
| 72 | + badgeShadow: { |
| 73 | + light: { shadowColor: '#000000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.06, shadowRadius: 6 }, |
| 74 | + dark: { shadowColor: '#B2B2B2', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.3, shadowRadius: 15 }, |
| 75 | + }, |
| 76 | + badgeTextShadow: { |
| 77 | + light: { textShadowColor: 'rgba(255, 255, 255, 0.46)', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 }, |
| 78 | + dark: { textShadowColor: 'rgba(255, 255, 255, 0.46)', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 }, |
| 79 | + }, |
| 80 | + }, |
| 81 | + STAKING_TIER_LEVEL_GOLD: { |
| 82 | + backgroundGradient: { |
| 83 | + light: { colors: [opacity('#FADB71', 0.4), opacity('#FADB71', 0)] }, |
| 84 | + dark: { colors: [opacity('#FADB71', 0.16), opacity('#FADB71', 0)] }, |
| 85 | + }, |
| 86 | + textGradient: { light: { colors: ['#4F3605', '#90630E'] }, dark: { colors: ['#4F3605', '#90630E'] } }, |
| 87 | + badgeTextGradient: { light: { colors: ['#4F3605', '#90630E'] }, dark: { colors: ['#4F3605', '#90630E'] } }, |
| 88 | + badgeGradient: { light: { colors: ['#FFE380', '#E3A700'] }, dark: { colors: ['#FFE380', '#E3A700'] } }, |
| 89 | + badgeBorderGradient: { |
| 90 | + light: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 91 | + dark: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 92 | + }, |
| 93 | + badgeShadow: { |
| 94 | + light: { shadowColor: '#000000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.06, shadowRadius: 6 }, |
| 95 | + dark: { shadowColor: '#FFDD20', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.3, shadowRadius: 15 }, |
| 96 | + }, |
| 97 | + badgeTextShadow: { |
| 98 | + light: { textShadowColor: 'rgba(255, 255, 255, 0.26)', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 }, |
| 99 | + dark: { textShadowColor: 'rgba(255, 255, 255, 0.26)', textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 }, |
| 100 | + }, |
| 101 | + }, |
| 102 | + STAKING_TIER_LEVEL_DIAMOND: { |
| 103 | + backgroundGradient: { |
| 104 | + light: { colors: [opacity('#D1E9F0', 0.4), opacity('#D1E9F0', 0)] }, |
| 105 | + dark: { colors: [opacity('#42D2EB', 0.16), opacity('#42D2EB', 0)] }, |
| 106 | + }, |
| 107 | + textGradient: { light: { colors: ['#424749', '#7CADB4'] }, dark: { colors: ['#424749', '#7CADB4'] } }, |
| 108 | + badgeTextGradient: { light: { colors: ['#424749', '#7CADB4'] }, dark: { colors: ['#314145', '#1D5D67'] } }, |
| 109 | + badgeGradient: { light: { colors: ['#ECF2F8', '#C8D1D7'] }, dark: { colors: ['#D5DCE3', '#9AA7B0'] } }, |
| 110 | + badgeBorderGradient: { |
| 111 | + light: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 112 | + dark: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 113 | + }, |
| 114 | + badgeShadow: { |
| 115 | + light: { shadowColor: '#000000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.06, shadowRadius: 6 }, |
| 116 | + dark: { shadowColor: '#42D2EB', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.3, shadowRadius: 15 }, |
| 117 | + }, |
| 118 | + badgeTextShadow: { |
| 119 | + light: { textShadowColor: opacity('#CBF6FF', 0.46), textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 }, |
| 120 | + dark: { textShadowColor: opacity('#CBF6FF', 0.46), textShadowOffset: { width: 1, height: 1 }, textShadowRadius: 0 }, |
| 121 | + }, |
| 122 | + }, |
| 123 | + STAKING_TIER_LEVEL_BLACK: { |
| 124 | + backgroundGradient: { |
| 125 | + light: { colors: [opacity('#FFFFFF', 0), opacity('#FFFFFF', 0)] }, |
| 126 | + dark: { colors: [opacity('#FFFFFF', 0), opacity('#FFFFFF', 0)] }, |
| 127 | + }, |
| 128 | + textGradient: { light: { colors: ['#000000', '#000000'] }, dark: { colors: ['#FFFFFF', '#FFFFFF'] } }, |
| 129 | + badgeTextGradient: { light: { colors: ['#FFFFFF', '#FFFFFF'] }, dark: { colors: ['#FFFFFF', '#FFFFFF'] } }, |
| 130 | + badgeGradient: { |
| 131 | + light: { colors: ['#444444', '#000000'] }, |
| 132 | + dark: { colors: ['#444444', '#000000'] }, |
| 133 | + }, |
| 134 | + badgeBorderGradient: { |
| 135 | + light: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 136 | + dark: { colors: [opacity(globalColors.grey100, 0.02), opacity(globalColors.grey100, 0.05)] }, |
| 137 | + }, |
| 138 | + badgeShadow: { |
| 139 | + light: { shadowColor: '#000000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.06, shadowRadius: 6 }, |
| 140 | + dark: { shadowColor: '#1A1C22', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.3, shadowRadius: 8 }, |
| 141 | + }, |
| 142 | + badgeTextShadow: { |
| 143 | + light: { textShadowColor: 'rgba(0, 0, 0, 0)', textShadowOffset: { width: 0, height: 0 }, textShadowRadius: 0 }, |
| 144 | + dark: { textShadowColor: 'rgba(0, 0, 0, 0)', textShadowOffset: { width: 0, height: 0 }, textShadowRadius: 0 }, |
| 145 | + }, |
| 146 | + }, |
| 147 | +}; |
| 148 | + |
| 149 | +export const FALLBACK_TIERS: Tier[] = [ |
| 150 | + { |
| 151 | + level: 'STAKING_TIER_LEVEL_BASIC', |
| 152 | + name: 'Basic', |
| 153 | + minStakeAmount: '0', |
| 154 | + cashbackBps: 1000, |
| 155 | + }, |
| 156 | + { |
| 157 | + level: 'STAKING_TIER_LEVEL_SILVER', |
| 158 | + name: 'Silver', |
| 159 | + minStakeAmount: '5000000000000000000000', |
| 160 | + cashbackBps: 2500, |
| 161 | + }, |
| 162 | + { |
| 163 | + level: 'STAKING_TIER_LEVEL_GOLD', |
| 164 | + name: 'Gold', |
| 165 | + minStakeAmount: '10000000000000000000000', |
| 166 | + cashbackBps: 5000, |
| 167 | + }, |
| 168 | + { |
| 169 | + level: 'STAKING_TIER_LEVEL_DIAMOND', |
| 170 | + name: 'Diamond', |
| 171 | + minStakeAmount: '15000000000000000000000', |
| 172 | + cashbackBps: 7500, |
| 173 | + }, |
| 174 | + { |
| 175 | + level: 'STAKING_TIER_LEVEL_BLACK', |
| 176 | + name: 'Black', |
| 177 | + minStakeAmount: '20000000000000000000000', |
| 178 | + cashbackBps: 10000, |
| 179 | + }, |
| 180 | +]; |
0 commit comments