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

Ingawei/twomba #2754

Merged
merged 14 commits into from
Jul 31, 2024
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
1 change: 1 addition & 0 deletions common/src/envs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const CONFIGS: { [env: string]: EnvConfig } = {
DEV: DEV_CONFIG,
}

export const TWOMBA_ENABLED = false
export const PRODUCT_MARKET_FIT_ENABLED = false
export const SPICE_PRODUCTION_ENABLED = true
export const SPICE_TO_MANA_CONVERSION_RATE = 1
Expand Down
4 changes: 2 additions & 2 deletions web/components/add-funds-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export const OtherWaysToGetMana = () => {
</Item>
<Item url="/referrals">
👋 Refer a friend for{' '}
<CoinNumber amount={REFERRAL_AMOUNT} isSpice isInline /> after their
first trade
<CoinNumber amount={REFERRAL_AMOUNT} coinType={'spice'} isInline />{' '}
after their first trade
</Item>
</ul>
)
Expand Down
2 changes: 1 addition & 1 deletion web/components/buttons/referrals-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function Referrals(props: { user: User }) {
Refer a friend for{' '}
<span className={'text-teal-500'}>
<CoinNumber
isSpice
coinType="spice"
amount={REFERRAL_AMOUNT}
style={{
color: SPICE_COLOR,
Expand Down
2 changes: 1 addition & 1 deletion web/components/gidx/register-user-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const RegisterUserForm = (props: { user: User }) => {
<br />
You have{' '}
<CoinNumber
isSpice
coinType="spice"
amount={user.spiceBalance}
style={{
color: SPICE_COLOR,
Expand Down
2 changes: 1 addition & 1 deletion web/components/nav/bottom-nav-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function NavBarItem(props: {
amount={user?.spiceBalance}
numberType="short"
className="text-amber-600 dark:text-amber-400"
isSpice
coinType="spice"
/>
</Row>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion web/components/nav/profile-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function ProfileSummary(props: { user: User; className?: string }) {
<CoinNumber
className="text-sm text-amber-600 dark:text-amber-400"
amount={user.spiceBalance}
isSpice
coinType="spice"
/>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/components/notifications/notification-types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ function ReferralProgramNotification(props: {
<span>
Refer friends and get{' '}
<CoinNumber
isSpice
coinType="spice"
amount={REFERRAL_AMOUNT}
style={{
color: SPICE_COLOR,
Expand Down
2 changes: 1 addition & 1 deletion web/components/portfolio/portfolio-graph-number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function PortfolioGraphNumber(props: {
<CoinNumber
amount={displayedAmount}
className={clsx('font-bold transition-all', className)}
isSpice={isSpice}
coinType={isSpice ? 'spice' : 'mana'}
/>

<div
Expand Down
38 changes: 27 additions & 11 deletions web/components/portfolio/portfolio-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { LoadingContractRow } from '../contract/contracts-table'
import { Col } from '../layout/col'
import { SupabaseSearch } from '../supabase-search'
import { PortfolioValueSection } from './portfolio-value-section'
import { TWOMBA_ENABLED } from 'common/envs/constants'
import { TwombaPortfolioValueSection } from './twomba-portfolio-value-section'

export const PortfolioSummary = (props: { user: User; className?: string }) => {
const { user, className } = props
Expand All @@ -23,17 +25,31 @@ export const PortfolioSummary = (props: { user: User; className?: string }) => {

return (
<Col className={clsx(className, 'gap-4')}>
<PortfolioValueSection
user={user}
defaultTimePeriod={
isCreatedInLastWeek
? 'allTime'
: currentUser?.id === user.id
? 'weekly'
: 'monthly'
}
portfolio={portfolioData}
/>
{TWOMBA_ENABLED ? (
<TwombaPortfolioValueSection
user={user}
defaultTimePeriod={
isCreatedInLastWeek
? 'allTime'
: currentUser?.id === user.id
? 'weekly'
: 'monthly'
}
portfolio={portfolioData}
/>
) : (
<PortfolioValueSection
user={user}
defaultTimePeriod={
isCreatedInLastWeek
? 'allTime'
: currentUser?.id === user.id
? 'weekly'
: 'monthly'
}
portfolio={portfolioData}
/>
)}

{isCurrentUser && (
<Col className="mb-6 mt-2 gap-2">
Expand Down
Loading
Loading