diff --git a/libs/chains/package.json b/libs/chains/package.json index 673a013cda6..3d7e080368d 100644 --- a/libs/chains/package.json +++ b/libs/chains/package.json @@ -31,7 +31,6 @@ "protobufjs": "^6.1.13" }, "devDependencies": { - "@types/moment": "^2.13.0", "tsx": "^4.7.2" } } diff --git a/libs/core/package.json b/libs/core/package.json index 03f914245b5..d57d2e49bfe 100644 --- a/libs/core/package.json +++ b/libs/core/package.json @@ -38,7 +38,6 @@ "zod": "^3.22.4" }, "devDependencies": { - "@types/moment": "^2.13.0", "@types/sinon": "^17.0.3", "sinon": "^17.0.2", "tsx": "^4.7.2" diff --git a/libs/core/src/integration/events.schemas.ts b/libs/core/src/integration/events.schemas.ts index 3f9d2194bf0..cbf9052ba53 100644 --- a/libs/core/src/integration/events.schemas.ts +++ b/libs/core/src/integration/events.schemas.ts @@ -263,4 +263,9 @@ export const FarcasterVoteCreated = FarcasterAction.extend({ contest_address: z.string(), }).describe('When a farcaster action is initiated on a cast reply'); +export const SignUpFlowCompleted = z.object({ + user_id: z.number(), + referral_link: z.string(), +}); + export const ContestRolloverTimerTicked = z.object({}); diff --git a/libs/core/src/integration/events.ts b/libs/core/src/integration/events.ts index 5c7d29fc1d9..37b5e42db74 100644 --- a/libs/core/src/integration/events.ts +++ b/libs/core/src/integration/events.ts @@ -39,6 +39,9 @@ export enum EventNames { // Preferences SubscriptionPreferencesUpdated = 'SubscriptionPreferencesUpdated', + + // Referrals + SignUpFlowCompleted = 'SignUpFlowCompleted', } export type EventPairs = @@ -141,4 +144,8 @@ export type EventPairs = | { event_name: EventNames.DiscordThreadDeleted; event_payload: z.infer; + } + | { + event_name: EventNames.SignUpFlowCompleted; + event_payload: z.infer; }; diff --git a/libs/core/src/integration/outbox.schema.ts b/libs/core/src/integration/outbox.schema.ts index 08646726714..f1a88355eb2 100644 --- a/libs/core/src/integration/outbox.schema.ts +++ b/libs/core/src/integration/outbox.schema.ts @@ -31,6 +31,7 @@ const outboxEvents = { [E.GroupCreated]: P.GroupCreated, [E.OneOffContestManagerDeployed]: P.OneOffContestManagerDeployed, [E.RecurringContestManagerDeployed]: P.RecurringContestManagerDeployed, + [E.SignUpFlowCompleted]: P.SignUpFlowCompleted, [E.SnapshotProposalCreated]: P.SnapshotProposalCreated, [E.SubscriptionPreferencesUpdated]: P.SubscriptionPreferencesUpdated, [E.ThreadCreated]: P.ThreadCreated, diff --git a/libs/model/package.json b/libs/model/package.json index b3075184914..255b819e231 100644 --- a/libs/model/package.json +++ b/libs/model/package.json @@ -64,7 +64,6 @@ "zod": "^3.22.4" }, "devDependencies": { - "@types/moment": "^2.13.0", "@types/node": "^20.11.25", "@types/sinon": "^17.0.3", "sinon": "^17.0.2", diff --git a/libs/model/src/community/UpdateCustomDomain.command.ts b/libs/model/src/community/UpdateCustomDomain.command.ts index 48e5aaab4f6..e4ae288fc26 100644 --- a/libs/model/src/community/UpdateCustomDomain.command.ts +++ b/libs/model/src/community/UpdateCustomDomain.command.ts @@ -39,7 +39,7 @@ export function UpdateCustomDomain(): Command< } const magicRequestDomain = await fetch( - `https://api.magic.link/v1/api/magic_client/domain/allowlist/add`, + `https://api.magic.link/v2/api/magic_client/domain/allowlist/add`, { method: 'POST', headers: { @@ -55,7 +55,7 @@ export function UpdateCustomDomain(): Command< ); const magicRequestRedirectUrl = await fetch( - `https://api.magic.link/v1/api/magic_client/redirect_url/allowlist/add`, + `https://api.magic.link/v2/api/magic_client/redirect_url/allowlist/add`, { method: 'POST', headers: { @@ -77,14 +77,14 @@ export function UpdateCustomDomain(): Command< magicResponseDomain.status === 'failed' && magicResponseDomain.error_code != 'ALREADY_WHITELISTED_DOMAIN' ) { - throw new AppError(magicResponseDomain); + throw new AppError(magicResponseDomain.message); } if ( magicResponseRedirectUrl.status === 'failed' && magicResponseRedirectUrl.error_code != 'ALREADY_WHITELISTED_DOMAIN' ) { - throw new AppError(magicResponseRedirectUrl); + throw new AppError(magicResponseRedirectUrl.message); } response = await fetch(url, { diff --git a/libs/model/src/contest/Contests.projection.ts b/libs/model/src/contest/Contests.projection.ts index e192526ffa0..904738e0cdb 100644 --- a/libs/model/src/contest/Contests.projection.ts +++ b/libs/model/src/contest/Contests.projection.ts @@ -8,7 +8,11 @@ import { models } from '../database'; import { mustExist } from '../middleware/guards'; import { EvmEventSourceAttributes } from '../models'; import * as protocol from '../services/commonProtocol'; -import { decodeThreadContentUrl, getChainNodeUrl } from '../utils'; +import { + decodeThreadContentUrl, + getChainNodeUrl, + getDefaultContestImage, +} from '../utils'; const log = logger(import.meta); @@ -104,7 +108,7 @@ async function updateOrCreateWithAlert( decimals, created_at: new Date(), name: community.name, - image_url: 'http://default.image', // TODO: can we have a default image for this? + image_url: getDefaultContestImage(), payout_structure: [], is_farcaster_contest: false, }, diff --git a/libs/model/src/contest/CreateContestManagerMetadata.command.ts b/libs/model/src/contest/CreateContestManagerMetadata.command.ts index eae7b396fb9..04d4ea242d6 100644 --- a/libs/model/src/contest/CreateContestManagerMetadata.command.ts +++ b/libs/model/src/contest/CreateContestManagerMetadata.command.ts @@ -6,6 +6,7 @@ import { models } from '../database'; import { authRoles } from '../middleware'; import { mustExist } from '../middleware/guards'; import { TopicInstance } from '../models'; +import { getDefaultContestImage } from '../utils'; const Errors = { InvalidTopics: 'Invalid topic', @@ -53,6 +54,7 @@ export function CreateContestManagerMetadata(): Command< : null, topic_id: topic?.id || null, is_farcaster_contest: !!is_farcaster_contest, + image_url: rest.image_url || getDefaultContestImage(), }, { transaction }, ); diff --git a/libs/model/src/contest/GetAllContests.query.ts b/libs/model/src/contest/GetAllContests.query.ts index 4c1a128d1a7..fd41a4d345f 100644 --- a/libs/model/src/contest/GetAllContests.query.ts +++ b/libs/model/src/contest/GetAllContests.query.ts @@ -1,4 +1,4 @@ -import { InvalidInput, Query } from '@hicommonwealth/core'; +import { Query } from '@hicommonwealth/core'; import * as schemas from '@hicommonwealth/schemas'; import { QueryTypes } from 'sequelize'; import { z } from 'zod'; @@ -10,9 +10,6 @@ export function GetAllContests(): Query { auth: [], secure: false, body: async ({ payload }) => { - if (!payload.community_id && !payload.contest_address) { - throw new InvalidInput('Must specify community_id or contest_address'); - } const results = await models.sequelize.query< z.infer >( @@ -72,7 +69,7 @@ from ${payload.contest_id ? `where c.contest_id = ${payload.contest_id}` : ''} group by c.contest_address ) as c on cm.contest_address = c.contest_address -where +${payload.community_id || payload.contest_address ? 'where' : ''} ${payload.community_id ? 'cm.community_id = :community_id' : ''} ${payload.community_id && payload.contest_address ? 'and' : ''} ${payload.contest_address ? `cm.contest_address = :contest_address` : ''} diff --git a/libs/model/src/user/UpdateUser.command.ts b/libs/model/src/user/UpdateUser.command.ts index e8fc23ee994..b9eb1d7b787 100644 --- a/libs/model/src/user/UpdateUser.command.ts +++ b/libs/model/src/user/UpdateUser.command.ts @@ -1,9 +1,9 @@ -import { InvalidInput, type Command } from '@hicommonwealth/core'; +import { EventNames, InvalidInput, type Command } from '@hicommonwealth/core'; import * as schemas from '@hicommonwealth/schemas'; import { DEFAULT_NAME } from '@hicommonwealth/shared'; import { models } from '../database'; import { mustExist } from '../middleware/guards'; -import { decodeContent, getDelta, updateTags } from '../utils'; +import { decodeContent, emitEvent, getDelta, updateTags } from '../utils'; export function UpdateUser(): Command { return { @@ -14,7 +14,7 @@ export function UpdateUser(): Command { if (actor.user.id != payload.id) throw new InvalidInput('Invalid user id'); - const { id, profile, tag_ids } = payload; + const { id, profile, tag_ids, referral_link } = payload; const { slug, name, @@ -78,7 +78,21 @@ export function UpdateUser(): Command { async (transaction) => { if (update_tags) await updateTags(tag_ids!, user.id!, 'user_id', transaction); + if (update_user) { + // emit sign-up flow completed event when: + if (user_delta.is_welcome_onboard_flow_complete && referral_link) + await emitEvent( + models.Outbox, + [ + { + event_name: EventNames.SignUpFlowCompleted, + event_payload: { user_id: id, referral_link }, + }, + ], + transaction, + ); + // TODO: utility to deep merge deltas const updates = { ...user_delta, diff --git a/libs/model/src/user/UserReferrals.projection.ts b/libs/model/src/user/UserReferrals.projection.ts index 7a47c275f9a..5c136cedc3e 100644 --- a/libs/model/src/user/UserReferrals.projection.ts +++ b/libs/model/src/user/UserReferrals.projection.ts @@ -3,6 +3,7 @@ import { models } from '../database'; const inputs = { CommunityCreated: events.CommunityCreated, + SignUpFlowCompleted: events.SignUpFlowCompleted, }; export function UserReferrals(): Projection { @@ -22,6 +23,19 @@ export function UserReferrals(): Projection { }); } }, + SignUpFlowCompleted: async ({ payload }) => { + const referral_link = payload.referral_link; + if (referral_link?.startsWith('ref_')) { + const referrer_id = parseInt(referral_link.split('_').at(1)!); + await models.Referral.create({ + referrer_id, + referee_id: payload.user_id, + event_name: 'SignUpFlowCompleted', + event_payload: payload, + created_at: new Date(), + }); + } + }, }, }; } diff --git a/libs/model/src/user/index.ts b/libs/model/src/user/index.ts index 43c06a2e6c0..3b39b081199 100644 --- a/libs/model/src/user/index.ts +++ b/libs/model/src/user/index.ts @@ -6,6 +6,7 @@ export * from './GetNewContent.query'; export * from './GetReferralLink.query'; export * from './GetUserAddresses.query'; export * from './GetUserProfile.query'; +export * from './GetUserReferrals.query'; export * from './SearchUserProfiles.query'; export * from './UpdateUser.command'; export * from './UserReferrals.projection'; diff --git a/libs/model/src/utils/getDefaultContestImage.ts b/libs/model/src/utils/getDefaultContestImage.ts new file mode 100644 index 00000000000..7f5c8c77ee7 --- /dev/null +++ b/libs/model/src/utils/getDefaultContestImage.ts @@ -0,0 +1,10 @@ +const defaultImages = [ + 'https://assets.commonwealth.im/42b9d2d9-79b8-473d-b404-b4e819328ded.png', + 'https://assets.commonwealth.im/496806e3-f662-4fb5-8da6-24a969f161f1.png', + 'https://assets.commonwealth.im/e4111236-8bdb-48bd-8821-4f03e8e978a6.png', + 'https://assets.commonwealth.im/fab3f073-9bf1-4ac3-8625-8b2ee258b5a8.png', +]; + +export function getDefaultContestImage() { + return defaultImages[Math.floor(Math.random() * defaultImages.length)]; +} diff --git a/libs/model/src/utils/index.ts b/libs/model/src/utils/index.ts index f38c614c89d..281f6a18509 100644 --- a/libs/model/src/utils/index.ts +++ b/libs/model/src/utils/index.ts @@ -3,6 +3,7 @@ export * from './buildFarcasterWebhookName'; export * from './decodeContent'; export * from './defaultAvatar'; export * from './denormalizedCountUtils'; +export * from './getDefaultContestImage'; export * from './getDelta'; export * from './makeGetBalancesOptions'; export * from './parseUserMentions'; diff --git a/libs/model/test/contest/check-contests.spec.ts b/libs/model/test/contest/check-contests.spec.ts index f01067e61c8..747465824af 100644 --- a/libs/model/test/contest/check-contests.spec.ts +++ b/libs/model/test/contest/check-contests.spec.ts @@ -11,7 +11,7 @@ import { expect } from 'chai'; import { Contests } from 'model/src/contest'; import { literal } from 'sequelize'; import { afterAll, beforeAll, describe, test } from 'vitest'; -import { bootstrap_testing, seed } from '../../src/tester'; +import { seed } from '../../src/tester'; import { drainOutbox } from '../utils'; describe('Check Contests', () => { @@ -25,8 +25,6 @@ describe('Check Contests', () => { const topicId: number = 0; beforeAll(async () => { - await bootstrap_testing(import.meta); - const [chainNode] = await seed('ChainNode', { contracts: [] }); const [user] = await seed( 'User', diff --git a/libs/model/test/contest/contest-worker-policy-lifecycle.spec.ts b/libs/model/test/contest/contest-worker-policy-lifecycle.spec.ts index 58c3c331af3..707e59d4aaa 100644 --- a/libs/model/test/contest/contest-worker-policy-lifecycle.spec.ts +++ b/libs/model/test/contest/contest-worker-policy-lifecycle.spec.ts @@ -7,7 +7,7 @@ import { afterAll, beforeAll, describe, test } from 'vitest'; import { commonProtocol, emitEvent, models } from '../../src'; import { Contests } from '../../src/contest'; import { ContestWorker } from '../../src/policies'; -import { bootstrap_testing, seed } from '../../src/tester'; +import { seed } from '../../src/tester'; import { drainOutbox } from '../utils/outbox-drain'; describe('Contest Worker Policy Lifecycle', () => { @@ -21,8 +21,6 @@ describe('Contest Worker Policy Lifecycle', () => { const topicId: number = 0; beforeAll(async () => { - await bootstrap_testing(import.meta); - const [chainNode] = await seed('ChainNode', { contracts: [] }); const [user] = await seed( 'User', diff --git a/libs/model/test/referral/referral-lifecycle.spec.ts b/libs/model/test/referral/referral-lifecycle.spec.ts index 50643b7e8b3..e1b5b08571f 100644 --- a/libs/model/test/referral/referral-lifecycle.spec.ts +++ b/libs/model/test/referral/referral-lifecycle.spec.ts @@ -5,7 +5,12 @@ import { GetUserReferrals } from 'model/src/user/GetUserReferrals.query'; import { afterAll, beforeAll, describe, expect, it } from 'vitest'; import { z } from 'zod'; import { CreateCommunity } from '../../src/community'; -import { CreateReferralLink, UserReferrals } from '../../src/user'; +import { + CreateReferralLink, + GetReferralLink, + UpdateUser, + UserReferrals, +} from '../../src/user'; import { drainOutbox, seedCommunity } from '../utils'; describe('Referral lifecycle', () => { @@ -26,7 +31,7 @@ describe('Referral lifecycle', () => { await dispose()(); }); - it('should create a referral', async () => { + it('should create a referral when creating a community with a referral link', async () => { // admin creates a referral link const response = await command(CreateReferralLink(), { actor: admin, @@ -84,4 +89,54 @@ describe('Referral lifecycle', () => { }, }); }); + + it('should create a referral when signing up with a referral link', async () => { + const response = await query(GetReferralLink(), { + actor: admin, + payload: {}, + }); + + // member signs up with the referral link + await command(UpdateUser(), { + actor: member, + payload: { + id: member.user.id!, + referral_link: response?.referral_link, + profile: { name: 'member' }, // this flags is_welcome_onboard_flow_complete + }, + }); + + await drainOutbox(['SignUpFlowCompleted'], UserReferrals); + + // get referrals + const referrals = await query(GetUserReferrals(), { + actor: admin, + payload: {}, + }); + + expect(referrals?.length).toBe(2); + + const ref = referrals!.at(1)!; + expect(ref).toMatchObject({ + referrer: { + id: admin.user.id, + profile: { + name: 'admin', + avatar_url: ref.referrer.profile.avatar_url, + }, + }, + referee: { + id: member.user.id, + profile: { + name: 'member', + avatar_url: ref.referee.profile.avatar_url, + }, + }, + event_name: 'SignUpFlowCompleted', + event_payload: { + user_id: member.user.id, + referral_link: response?.referral_link, + }, + }); + }); }); diff --git a/libs/model/test/seed/seed.spec.ts b/libs/model/test/seed/seed.spec.ts index 4598ab65fee..04e0e4c2068 100644 --- a/libs/model/test/seed/seed.spec.ts +++ b/libs/model/test/seed/seed.spec.ts @@ -45,8 +45,7 @@ async function testSeed( return data; } -// skip for now, seeds are being widely used in lifecycle tests -describe.skip('Seed functions', () => { +describe('Seed functions', () => { let shouldExit = true; afterAll(async () => { diff --git a/libs/model/test/subscription/subscription-preferences-lifecycle.spec.ts b/libs/model/test/subscription/subscription-preferences-lifecycle.spec.ts index 13c908cde2b..107610fecb0 100644 --- a/libs/model/test/subscription/subscription-preferences-lifecycle.spec.ts +++ b/libs/model/test/subscription/subscription-preferences-lifecycle.spec.ts @@ -1,13 +1,6 @@ import { Actor, command, dispose, query } from '@hicommonwealth/core'; import { expect } from 'chai'; -import { - afterAll, - afterEach, - beforeAll, - beforeEach, - describe, - test, -} from 'vitest'; +import { afterAll, beforeAll, beforeEach, describe, test } from 'vitest'; import { models } from '../../src/database'; import { GetSubscriptionPreferences, @@ -34,6 +27,8 @@ describe('Subscription preferences lifecycle', () => { }); beforeEach(async () => { + await models.SubscriptionPreference.truncate({}); + await models.Outbox.truncate({}); await seed('SubscriptionPreference', { user_id: actor.user.id, email_notifications_enabled: false, @@ -45,11 +40,6 @@ describe('Subscription preferences lifecycle', () => { }); }); - afterEach(async () => { - await models.SubscriptionPreference.truncate({}); - await models.Outbox.truncate({}); - }); - test('should update a single property in subscription preferences', async () => { const payload = { id: actor.user.id!, diff --git a/libs/model/test/utils/community-seeder.ts b/libs/model/test/utils/community-seeder.ts index 8d788af975e..eab800570f6 100644 --- a/libs/model/test/utils/community-seeder.ts +++ b/libs/model/test/utils/community-seeder.ts @@ -47,6 +47,7 @@ export async function seedCommunity({ const users = await seedRecord('User', roles, (role) => ({ profile: { name: role }, isAdmin: role === 'admin', + is_welcome_onboard_flow_complete: false, })); // seed ethereum base community diff --git a/libs/schemas/package.json b/libs/schemas/package.json index fbb5721cd43..29c4b945ef3 100644 --- a/libs/schemas/package.json +++ b/libs/schemas/package.json @@ -26,8 +26,5 @@ "@hicommonwealth/evm-protocols": "workspace:*", "moment": "^2.23.0", "zod": "^3.22.4" - }, - "devDependencies": { - "@types/moment": "^2.13.0" } } diff --git a/libs/schemas/src/commands/user.schemas.ts b/libs/schemas/src/commands/user.schemas.ts index b425328e5c2..72a42546f15 100644 --- a/libs/schemas/src/commands/user.schemas.ts +++ b/libs/schemas/src/commands/user.schemas.ts @@ -6,6 +6,7 @@ export const UpdateUser = { id: z.number(), promotional_emails_enabled: z.boolean().nullish(), tag_ids: z.number().array().nullish(), + referral_link: z.string().nullish(), }), output: User, }; diff --git a/libs/schemas/src/entities/referral.schemas.ts b/libs/schemas/src/entities/referral.schemas.ts index 09be58d7ee4..76299036a3b 100644 --- a/libs/schemas/src/entities/referral.schemas.ts +++ b/libs/schemas/src/entities/referral.schemas.ts @@ -2,7 +2,10 @@ import z from 'zod'; import { PG_INT } from '../utils'; import { UserProfile } from './user.schemas'; -export const REFERRAL_EVENTS = ['CommunityCreated'] as const; +export const REFERRAL_EVENTS = [ + 'CommunityCreated', + 'SignUpFlowCompleted', +] as const; export const Referral = z .object({ diff --git a/libs/shared/package.json b/libs/shared/package.json index a826c635631..83fd11db881 100644 --- a/libs/shared/package.json +++ b/libs/shared/package.json @@ -40,8 +40,5 @@ "libp2p": "^2.1.3", "moment": "^2.23.0", "safe-stable-stringify": "^2.4.2" - }, - "devDependencies": { - "@types/moment": "^2.13.0" } } diff --git a/package.json b/package.json index 9c4bf423b04..ed7e619d1ea 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "@types/jsonwebtoken": "^8.3.9", "@types/lodash": "^4.14.123", "@types/marked": "^4.0.1", - "@types/moment": "^2.13.0", "@types/morgan": "^1.9.4", "@types/node": "^20.11.25", "@types/node-fetch": "2.x", diff --git a/packages/commonwealth/client/assets/img/branding/common.svg b/packages/commonwealth/client/assets/img/branding/common.svg index 2427009c405..2bda2ca1dab 100644 --- a/packages/commonwealth/client/assets/img/branding/common.svg +++ b/packages/commonwealth/client/assets/img/branding/common.svg @@ -1,15 +1,11 @@ - + - - - - + - + - - + diff --git a/packages/commonwealth/client/assets/img/share/discord.png b/packages/commonwealth/client/assets/img/share/discord.png new file mode 100644 index 00000000000..9bb2b748402 Binary files /dev/null and b/packages/commonwealth/client/assets/img/share/discord.png differ diff --git a/packages/commonwealth/client/assets/img/share/mail.png b/packages/commonwealth/client/assets/img/share/mail.png new file mode 100644 index 00000000000..0253d92235c Binary files /dev/null and b/packages/commonwealth/client/assets/img/share/mail.png differ diff --git a/packages/commonwealth/client/assets/img/share/messages.png b/packages/commonwealth/client/assets/img/share/messages.png new file mode 100644 index 00000000000..b77749835ba Binary files /dev/null and b/packages/commonwealth/client/assets/img/share/messages.png differ diff --git a/packages/commonwealth/client/assets/img/share/telegram.png b/packages/commonwealth/client/assets/img/share/telegram.png new file mode 100644 index 00000000000..3d4c9ca5568 Binary files /dev/null and b/packages/commonwealth/client/assets/img/share/telegram.png differ diff --git a/packages/commonwealth/client/assets/img/share/warpcast.png b/packages/commonwealth/client/assets/img/share/warpcast.png new file mode 100644 index 00000000000..c2d035be71f Binary files /dev/null and b/packages/commonwealth/client/assets/img/share/warpcast.png differ diff --git a/packages/commonwealth/client/assets/img/share/x.png b/packages/commonwealth/client/assets/img/share/x.png new file mode 100644 index 00000000000..31357ff3f25 Binary files /dev/null and b/packages/commonwealth/client/assets/img/share/x.png differ diff --git a/packages/commonwealth/client/scripts/helpers/feature-flags.ts b/packages/commonwealth/client/scripts/helpers/feature-flags.ts index 957102e9305..abe9a3cfcd7 100644 --- a/packages/commonwealth/client/scripts/helpers/feature-flags.ts +++ b/packages/commonwealth/client/scripts/helpers/feature-flags.ts @@ -29,6 +29,7 @@ const featureFlags = { newEditor: buildFlag(process.env.FLAG_NEW_EDITOR), tokenizedCommunity: buildFlag(process.env.FLAG_TOKENIZED_COMMUNITY), manageApiKeys: buildFlag(process.env.FLAG_MANAGE_API_KEYS), + referrals: buildFlag(process.env.FLAG_REFERRALS), }; export type AvailableFeatureFlag = keyof typeof featureFlags; diff --git a/packages/commonwealth/client/scripts/index.tsx b/packages/commonwealth/client/scripts/index.tsx index 0e296bae44b..997958e1789 100644 --- a/packages/commonwealth/client/scripts/index.tsx +++ b/packages/commonwealth/client/scripts/index.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { createRoot } from 'react-dom/client'; -import 'index.scss'; import 'react-toastify/dist/ReactToastify.css'; -import 'shared.scss'; -import '../styles/fonts.css'; -import '../styles/normalize.css'; // reset +import './styles/fonts.css'; +import './styles/index.scss'; +import './styles/normalize.css'; // reset +import './styles/shared.scss'; import App from './App'; import { getBrowserInfo } from './helpers/browser'; diff --git a/packages/commonwealth/client/scripts/state/api/contests/getContests.ts b/packages/commonwealth/client/scripts/state/api/contests/getContests.ts index a435d069b40..f7759acb828 100644 --- a/packages/commonwealth/client/scripts/state/api/contests/getContests.ts +++ b/packages/commonwealth/client/scripts/state/api/contests/getContests.ts @@ -5,6 +5,7 @@ import { trpc } from 'utils/trpcClient'; type UseGetContestsQueryProps = z.infer & { shouldPolling?: boolean; + fetchAll?: boolean; }; const CONTESTS_STALE_TIME = 10 * 1_000; // 10 s @@ -14,6 +15,7 @@ const useGetContestsQuery = ({ community_id, running, shouldPolling = false, + fetchAll = false, }: UseGetContestsQueryProps) => { return trpc.contest.getAllContests.useQuery( { @@ -22,7 +24,7 @@ const useGetContestsQuery = ({ running, }, { - enabled: !!community_id, + enabled: fetchAll ? true : !!community_id, staleTime: CONTESTS_STALE_TIME, refetchInterval: (data) => { if (!shouldPolling) { diff --git a/packages/commonwealth/client/scripts/state/ui/modals/index.ts b/packages/commonwealth/client/scripts/state/ui/modals/index.ts index c5f848bf9db..8352fab4857 100644 --- a/packages/commonwealth/client/scripts/state/ui/modals/index.ts +++ b/packages/commonwealth/client/scripts/state/ui/modals/index.ts @@ -1,10 +1,12 @@ import useAuthModalStore from './authModal'; +import useInviteLinkModal from './inviteLinkModal'; import useManageCommunityStakeModalStore from './manageCommunityStakeModal'; import useNewTopicModalStore from './newTopicModal'; import useWelcomeOnboardModal from './welcomeOnboardModal'; export { useAuthModalStore, + useInviteLinkModal, useManageCommunityStakeModalStore, useNewTopicModalStore, useWelcomeOnboardModal, diff --git a/packages/commonwealth/client/scripts/state/ui/modals/inviteLinkModal.ts b/packages/commonwealth/client/scripts/state/ui/modals/inviteLinkModal.ts new file mode 100644 index 00000000000..fcf74230864 --- /dev/null +++ b/packages/commonwealth/client/scripts/state/ui/modals/inviteLinkModal.ts @@ -0,0 +1,26 @@ +import { createBoundedUseStore } from 'state/ui/utils'; +import { devtools } from 'zustand/middleware'; +import { createStore } from 'zustand/vanilla'; + +interface InviteLinkModalProps { + isInviteLinkModalOpen: boolean; + setIsInviteLinkModalOpen: (isOpen: boolean) => void; +} + +export const inviteLinkModal = createStore()( + devtools((set) => ({ + isInviteLinkModalOpen: false, + setIsInviteLinkModalOpen: (isOpen) => { + set((state) => { + return { + ...state, + isInviteLinkModalOpen: isOpen, + }; + }); + }, + })), +); + +const useInviteLinkModal = createBoundedUseStore(inviteLinkModal); + +export default useInviteLinkModal; diff --git a/packages/commonwealth/client/styles/fonts.css b/packages/commonwealth/client/scripts/styles/fonts.css similarity index 84% rename from packages/commonwealth/client/styles/fonts.css rename to packages/commonwealth/client/scripts/styles/fonts.css index 680ec1e0d0b..1c6db27c345 100644 --- a/packages/commonwealth/client/styles/fonts.css +++ b/packages/commonwealth/client/scripts/styles/fonts.css @@ -2,7 +2,8 @@ font-family: Silka; font-weight: 900; font-style: normal; - src: url('assets/fonts/silka-black-webfont.eot'), + src: + url('assets/fonts/silka-black-webfont.eot'), url('assets/fonts/silka-black-webfont.woff2') format('woff2'), url('assets/fonts/silka-black-webfont.woff') format('woff'), url('assets/fonts/silka-black-webfont.ttf') format('truetype'); @@ -12,7 +13,8 @@ font-family: Silka; font-weight: 700; font-style: normal; - src: url('assets/fonts/silka-bold-webfont.eot'), + src: + url('assets/fonts/silka-bold-webfont.eot'), url('assets/fonts/silka-bold-webfont.woff2') format('woff2'), url('assets/fonts/silka-bold-webfont.woff') format('woff'), url('assets/fonts/silka-bold-webfont.ttf') format('truetype'); @@ -22,7 +24,8 @@ font-family: Silka; font-weight: 600; font-style: normal; - src: url('assets/fonts/silka-semibold-webfont.eot'), + src: + url('assets/fonts/silka-semibold-webfont.eot'), url('assets/fonts/silka-semibold-webfont.woff2') format('woff2'), url('assets/fonts/silka-semibold-webfont.woff') format('woff'), url('assets/fonts/silka-semibold-webfont.ttf') format('truetype'); @@ -32,7 +35,8 @@ font-family: Silka; font-weight: 500; font-style: normal; - src: url('assets/fonts/silka-medium-webfont.eot'), + src: + url('assets/fonts/silka-medium-webfont.eot'), url('assets/fonts/silka-medium-webfont.woff2') format('woff2'), url('assets/fonts/silka-medium-webfont.woff') format('woff'), url('assets/fonts/silka-medium-webfont.ttf') format('truetype'); @@ -42,7 +46,8 @@ font-family: NeueHaasUnica; font-weight: 500; font-style: normal; - src: url('assets/fonts/NeueHaasUnica-Medium.eot'), + src: + url('assets/fonts/NeueHaasUnica-Medium.eot'), url('assets/fonts/NeueHaasUnica-Medium.woff2') format('woff2'), url('assets/fonts/NeueHaasUnica-Medium.woff') format('woff'), url('assets/fonts/NeueHaasUnica-Medium.ttf') format('truetype'); @@ -52,7 +57,8 @@ font-family: NeueHaasUnica; font-weight: 400; font-style: normal; - src: url('assets/fonts/NeueHaasUnica-Regular.eot'), + src: + url('assets/fonts/NeueHaasUnica-Regular.eot'), url('assets/fonts/NeueHaasUnica-Regular.woff2') format('woff2'), url('assets/fonts/NeueHaasUnica-Regular.woff') format('woff'), url('assets/fonts/NeueHaasUnica-Regular.ttf') format('truetype'); diff --git a/packages/commonwealth/client/styles/index.scss b/packages/commonwealth/client/scripts/styles/index.scss similarity index 97% rename from packages/commonwealth/client/styles/index.scss rename to packages/commonwealth/client/scripts/styles/index.scss index 928f86ee82d..eb972638a77 100644 --- a/packages/commonwealth/client/styles/index.scss +++ b/packages/commonwealth/client/scripts/styles/index.scss @@ -62,7 +62,9 @@ html { -moz-transition: 0.2s filter ease-in-out; -ms-transition: 0.2s -ms-filter ease-in-out; -o-transition: 0.2s -o-filter ease-in-out; - transition: 0.2s filter ease-in-out, 0.2s -webkit-filter ease-in-out; + transition: + 0.2s filter ease-in-out, + 0.2s -webkit-filter ease-in-out; } .app-loading { diff --git a/packages/commonwealth/client/styles/mixins/border.scss b/packages/commonwealth/client/scripts/styles/mixins/border.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/border.scss rename to packages/commonwealth/client/scripts/styles/mixins/border.scss diff --git a/packages/commonwealth/client/styles/mixins/border_radius.scss b/packages/commonwealth/client/scripts/styles/mixins/border_radius.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/border_radius.scss rename to packages/commonwealth/client/scripts/styles/mixins/border_radius.scss diff --git a/packages/commonwealth/client/styles/mixins/breakpoints.module.scss b/packages/commonwealth/client/scripts/styles/mixins/breakpoints.module.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/breakpoints.module.scss rename to packages/commonwealth/client/scripts/styles/mixins/breakpoints.module.scss diff --git a/packages/commonwealth/client/styles/mixins/buttons.scss b/packages/commonwealth/client/scripts/styles/mixins/buttons.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/buttons.scss rename to packages/commonwealth/client/scripts/styles/mixins/buttons.scss diff --git a/packages/commonwealth/client/styles/mixins/choice.scss b/packages/commonwealth/client/scripts/styles/mixins/choice.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/choice.scss rename to packages/commonwealth/client/scripts/styles/mixins/choice.scss diff --git a/packages/commonwealth/client/styles/mixins/colors.module.scss b/packages/commonwealth/client/scripts/styles/mixins/colors.module.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/colors.module.scss rename to packages/commonwealth/client/scripts/styles/mixins/colors.module.scss diff --git a/packages/commonwealth/client/scripts/styles/mixins/elevation.scss b/packages/commonwealth/client/scripts/styles/mixins/elevation.scss new file mode 100644 index 00000000000..e6f9b16617b --- /dev/null +++ b/packages/commonwealth/client/scripts/styles/mixins/elevation.scss @@ -0,0 +1,13 @@ +$elevation-1: 0px 1px 2px rgba(40, 39, 41, 0.05); +$elevation-2: + 0px 1px 3px rgba(40, 39, 41, 0.1), + 0px 1px 2px rgba(40, 39, 41, 0.06); +$elevation-3: + 0px 4px 8px -2px rgba(40, 39, 41, 0.1), + 0px 2px 4px -2px rgba(40, 39, 41, 0.06); +$elevation-4: + 0px 12px 16px -4px rgba(40, 39, 41, 0.08), + 0px 4px 6px -2px rgba(40, 39, 41, 0.03); +$elevation-5: + 0px 20px 24px -4px rgba(40, 39, 41, 0.08), + 0px 8px 8px -4px rgba(40, 39, 41, 0.03); diff --git a/packages/commonwealth/client/styles/mixins/icons.scss b/packages/commonwealth/client/scripts/styles/mixins/icons.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/icons.scss rename to packages/commonwealth/client/scripts/styles/mixins/icons.scss diff --git a/packages/commonwealth/client/styles/mixins/inputs.scss b/packages/commonwealth/client/scripts/styles/mixins/inputs.scss similarity index 94% rename from packages/commonwealth/client/styles/mixins/inputs.scss rename to packages/commonwealth/client/scripts/styles/mixins/inputs.scss index 2befe0eade1..6979d5bfb24 100644 --- a/packages/commonwealth/client/styles/mixins/inputs.scss +++ b/packages/commonwealth/client/scripts/styles/mixins/inputs.scss @@ -7,7 +7,9 @@ font-style: normal; font-weight: 400; letter-spacing: 0.01em; - font-feature-settings: 'tnum' on, 'lnum' on; + font-feature-settings: + 'tnum' on, + 'lnum' on; &::placeholder { color: $neutral-500; @@ -23,7 +25,8 @@ &:focus-within { border-color: $primary-500 !important; - box-shadow: 0px 2px 2px -1px rgba(0, 0, 0, 0.12), + box-shadow: + 0px 2px 2px -1px rgba(0, 0, 0, 0.12), 0px 0px 0px 3px $primary-100 !important; &::placeholder { diff --git a/packages/commonwealth/client/styles/mixins/media_queries.scss b/packages/commonwealth/client/scripts/styles/mixins/media_queries.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/media_queries.scss rename to packages/commonwealth/client/scripts/styles/mixins/media_queries.scss diff --git a/packages/commonwealth/client/scripts/styles/mixins/table.scss b/packages/commonwealth/client/scripts/styles/mixins/table.scss new file mode 100644 index 00000000000..7e4190c3f76 --- /dev/null +++ b/packages/commonwealth/client/scripts/styles/mixins/table.scss @@ -0,0 +1,33 @@ +@mixin table-cell { + .table-cell { + display: flex; + gap: 8px; + align-items: center; + flex-wrap: wrap; + + .user-info { + text-decoration: none; + display: flex; + align-items: center; + gap: 8px; + color: black; + + div { + display: flex; + justify-content: center; + align-items: center; + } + + :hover, + :focus, + :visited { + text-decoration: underline; + } + } + + &.text-right { + display: block; + text-align: right; + } + } +} diff --git a/packages/commonwealth/client/styles/mixins/text.scss b/packages/commonwealth/client/scripts/styles/mixins/text.scss similarity index 100% rename from packages/commonwealth/client/styles/mixins/text.scss rename to packages/commonwealth/client/scripts/styles/mixins/text.scss diff --git a/packages/commonwealth/client/styles/normalize.css b/packages/commonwealth/client/scripts/styles/normalize.css similarity index 100% rename from packages/commonwealth/client/styles/normalize.css rename to packages/commonwealth/client/scripts/styles/normalize.css diff --git a/packages/commonwealth/client/styles/shared.scss b/packages/commonwealth/client/scripts/styles/shared.scss similarity index 93% rename from packages/commonwealth/client/styles/shared.scss rename to packages/commonwealth/client/scripts/styles/shared.scss index 8526dbcabaf..911ba05f143 100644 --- a/packages/commonwealth/client/styles/shared.scss +++ b/packages/commonwealth/client/scripts/styles/shared.scss @@ -8,6 +8,7 @@ @import 'mixins/inputs'; @import 'mixins/icons'; @import 'mixins/text'; +@import 'mixins/table'; @import 'utils'; // layout & global nav parameters @@ -23,8 +24,14 @@ $sidebar-community-header-height: 56px; $fonts: NeueHaasUnica, Silka, 'Segoe UI', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; -$monospace-fonts: SF Mono, Menlo, Monaco, 'Lucida Sans Typewriter', - 'Courier New', Courier, monospace; +$monospace-fonts: + SF Mono, + Menlo, + Monaco, + 'Lucida Sans Typewriter', + 'Courier New', + Courier, + monospace; $font-family-silka: Silka, sans-serif; diff --git a/packages/commonwealth/client/styles/utils.scss b/packages/commonwealth/client/scripts/styles/utils.scss similarity index 100% rename from packages/commonwealth/client/styles/utils.scss rename to packages/commonwealth/client/scripts/styles/utils.scss diff --git a/packages/commonwealth/client/styles/Layout.scss b/packages/commonwealth/client/scripts/views/Layout.scss similarity index 91% rename from packages/commonwealth/client/styles/Layout.scss rename to packages/commonwealth/client/scripts/views/Layout.scss index 12c48571d7a..0e28db4d001 100644 --- a/packages/commonwealth/client/styles/Layout.scss +++ b/packages/commonwealth/client/scripts/views/Layout.scss @@ -1,4 +1,4 @@ -@import 'shared'; +@import '../styles/shared.scss'; .Layout { height: 100%; diff --git a/packages/commonwealth/client/scripts/views/Layout.tsx b/packages/commonwealth/client/scripts/views/Layout.tsx index bb31ee55615..b00c8efe85c 100644 --- a/packages/commonwealth/client/scripts/views/Layout.tsx +++ b/packages/commonwealth/client/scripts/views/Layout.tsx @@ -1,5 +1,4 @@ import { ExtendedCommunity } from '@hicommonwealth/schemas'; -import 'Layout.scss'; import { deinitChainOrCommunity, loadCommunityChainInfo } from 'helpers/chain'; import withRouter, { useCommonNavigate } from 'navigation/helpers'; import React, { ReactNode, Suspense, useEffect, useState } from 'react'; @@ -19,6 +18,7 @@ import useAppStatus from '../hooks/useAppStatus'; import useNecessaryEffect from '../hooks/useNecessaryEffect'; import { useGetCommunityByIdQuery } from '../state/api/communities'; import { useUpdateUserActiveCommunityMutation } from '../state/api/user'; +import './Layout.scss'; import SubLayout from './Sublayout'; import MetaTags from './components/MetaTags'; import { CWEmptyState } from './components/component_kit/cw_empty_state'; diff --git a/packages/commonwealth/client/styles/Sublayout.scss b/packages/commonwealth/client/scripts/views/Sublayout.scss similarity index 98% rename from packages/commonwealth/client/styles/Sublayout.scss rename to packages/commonwealth/client/scripts/views/Sublayout.scss index 715ec8f2647..58a423a2f74 100644 --- a/packages/commonwealth/client/styles/Sublayout.scss +++ b/packages/commonwealth/client/scripts/views/Sublayout.scss @@ -1,4 +1,4 @@ -@import 'shared'; +@import '../styles/shared.scss'; .Sublayout { display: flex; diff --git a/packages/commonwealth/client/scripts/views/Sublayout.tsx b/packages/commonwealth/client/scripts/views/Sublayout.tsx index 6de7c482e56..aab85c1aa1c 100644 --- a/packages/commonwealth/client/scripts/views/Sublayout.tsx +++ b/packages/commonwealth/client/scripts/views/Sublayout.tsx @@ -1,4 +1,3 @@ -import 'Sublayout.scss'; import clsx from 'clsx'; import useBrowserWindow from 'hooks/useBrowserWindow'; import useWindowResize from 'hooks/useWindowResize'; @@ -10,16 +9,23 @@ import { SublayoutHeader } from 'views/components/SublayoutHeader'; import { Sidebar } from 'views/components/sidebar'; import useNecessaryEffect from '../hooks/useNecessaryEffect'; import useStickyHeader from '../hooks/useStickyHeader'; -import { useAuthModalStore, useWelcomeOnboardModal } from '../state/ui/modals'; +import { + useAuthModalStore, + useInviteLinkModal, + useWelcomeOnboardModal, +} from '../state/ui/modals'; import useUserStore from '../state/ui/user'; +import './Sublayout.scss'; import { SublayoutBanners } from './SublayoutBanners'; import { AdminOnboardingSlider } from './components/AdminOnboardingSlider'; import { Breadcrumbs } from './components/Breadcrumbs'; import MobileNavigation from './components/MobileNavigation'; import AuthButtons from './components/SublayoutHeader/AuthButtons'; import { UserTrainingSlider } from './components/UserTrainingSlider'; +import { CWModal } from './components/component_kit/new_designs/CWModal'; import CollapsableSidebarButton from './components/sidebar/CollapsableSidebarButton'; import { AuthModal, AuthModalType } from './modals/AuthModal'; +import InviteLinkModal from './modals/InviteLinkModal'; import { WelcomeOnboardModal } from './modals/WelcomeOnboardModal'; type SublayoutProps = { @@ -46,6 +52,9 @@ const Sublayout = ({ children, isInsideCommunity }: SublayoutProps) => { const { isWelcomeOnboardModalOpen, setIsWelcomeOnboardModalOpen } = useWelcomeOnboardModal(); + const { isInviteLinkModalOpen, setIsInviteLinkModalOpen } = + useInviteLinkModal(); + useNecessaryEffect(() => { if ( user.isLoggedIn && @@ -178,6 +187,17 @@ const Sublayout = ({ children, isInsideCommunity }: SublayoutProps) => { isOpen={isWelcomeOnboardModalOpen} onClose={() => setIsWelcomeOnboardModalOpen(false)} /> + setIsInviteLinkModalOpen(false)} + isInsideCommunity={!!isInsideCommunity} + /> + } + open={!isWindowExtraSmall && isInviteLinkModalOpen} + onClose={() => setIsInviteLinkModalOpen(false)} + /> {isWindowExtraSmall && } diff --git a/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/AndroidPrompt/AndroidPrompt.scss b/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/AndroidPrompt/AndroidPrompt.scss index 150b4c24609..b05d7aa5ff6 100644 --- a/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/AndroidPrompt/AndroidPrompt.scss +++ b/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/AndroidPrompt/AndroidPrompt.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .AndroidPrompt { display: flex; @@ -71,7 +71,8 @@ .prompt-content { background-color: $white; - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), + box-shadow: + 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); padding: 8px 24px 8px; border-radius: 26px; diff --git a/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/IOSPrompt/IOSPrompt.scss b/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/IOSPrompt/IOSPrompt.scss index 7a0bb3caf4f..127a772014f 100644 --- a/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/IOSPrompt/IOSPrompt.scss +++ b/packages/commonwealth/client/scripts/views/components/AddToHomeScreenPrompt/IOSPrompt/IOSPrompt.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .IOSPrompt { display: flex; @@ -36,7 +36,8 @@ .prompt-content { background-color: $white; - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), + box-shadow: + 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); padding: 16px; border-radius: 6px; diff --git a/packages/commonwealth/client/scripts/views/components/AuthButton/AuthButton.scss b/packages/commonwealth/client/scripts/views/components/AuthButton/AuthButton.scss index 87fb966cf69..5b99bae6124 100644 --- a/packages/commonwealth/client/scripts/views/components/AuthButton/AuthButton.scss +++ b/packages/commonwealth/client/scripts/views/components/AuthButton/AuthButton.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .AuthButton { display: flex; diff --git a/packages/commonwealth/client/styles/components/Avatar/AvatarUpload.scss b/packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.scss similarity index 96% rename from packages/commonwealth/client/styles/components/Avatar/AvatarUpload.scss rename to packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.scss index 9906d06062b..d21d256d9ba 100644 --- a/packages/commonwealth/client/styles/components/Avatar/AvatarUpload.scss +++ b/packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .AvatarUpload { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.tsx b/packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.tsx index 92b864f178d..e697f5491e7 100644 --- a/packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.tsx +++ b/packages/commonwealth/client/scripts/views/components/Avatar/AvatarUpload.tsx @@ -1,4 +1,3 @@ -import 'components/Avatar/AvatarUpload.scss'; import { notifyError } from 'controllers/app/notifications'; import React, { useState } from 'react'; import { useDropzone } from 'react-dropzone'; @@ -8,6 +7,7 @@ import { Avatar } from 'views/components/Avatar/Avatar'; import { CWIconButton } from '../component_kit/cw_icon_button'; import { getClasses } from '../component_kit/helpers'; import { ComponentType } from '../component_kit/types'; +import './AvatarUpload.scss'; type AvatarUploadStyleProps = { size?: 'small' | 'large'; diff --git a/packages/commonwealth/client/scripts/views/components/Breadcrumbs/Breadcrumbs.scss b/packages/commonwealth/client/scripts/views/components/Breadcrumbs/Breadcrumbs.scss index 4483a0e0492..766da5e3de1 100644 --- a/packages/commonwealth/client/scripts/views/components/Breadcrumbs/Breadcrumbs.scss +++ b/packages/commonwealth/client/scripts/views/components/Breadcrumbs/Breadcrumbs.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .BreadcrumbsPageLayout { padding-block: 0; @@ -13,7 +13,7 @@ z-index: 3; overflow: auto; width: 100%; - max-width: 1000px; + max-width: 1040px; overflow: hidden; max-height: 52px !important; min-height: 52px !important; @@ -21,7 +21,6 @@ @include extraSmall { position: static; } - .disable-active-cursor { &:hover { cursor: default; @@ -31,7 +30,7 @@ .BreadcrumbsBlockContentArea { width: 100%; - max-width: 1000px; + max-width: 1040px; max-height: 52px !important; min-height: 52px !important; @include extraSmall { diff --git a/packages/commonwealth/client/scripts/views/components/Breadcrumbs/utils.ts b/packages/commonwealth/client/scripts/views/components/Breadcrumbs/utils.ts index ea8373403d7..4011a7594f6 100644 --- a/packages/commonwealth/client/scripts/views/components/Breadcrumbs/utils.ts +++ b/packages/commonwealth/client/scripts/views/components/Breadcrumbs/utils.ts @@ -175,8 +175,18 @@ export const generateBreadcrumbs = ( } if (pathSegments.includes('contests')) { - if (index === 2 && pathSegment !== 'launch') { - label = 'Edit'; + if (pathSegments.includes('manage')) { + if (index === 2 && pathSegment !== 'launch') { + label = 'Edit'; + } + } else { + if (index === 1 && pathSegment === 'contests') { + link = 'contests'; + } + + if (index === 2) { + label = 'Leaderboard'; + } } } diff --git a/packages/commonwealth/client/scripts/views/components/CWAccordion/CWAccordion.scss b/packages/commonwealth/client/scripts/views/components/CWAccordion/CWAccordion.scss index 7ecc13cc059..13a8d93a86a 100644 --- a/packages/commonwealth/client/scripts/views/components/CWAccordion/CWAccordion.scss +++ b/packages/commonwealth/client/scripts/views/components/CWAccordion/CWAccordion.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .CWAccordion { summary { diff --git a/packages/commonwealth/client/scripts/views/components/CardsSlider/ActionCard/ActionCard.scss b/packages/commonwealth/client/scripts/views/components/CardsSlider/ActionCard/ActionCard.scss index 5b913a52524..0a9e8f4b024 100644 --- a/packages/commonwealth/client/scripts/views/components/CardsSlider/ActionCard/ActionCard.scss +++ b/packages/commonwealth/client/scripts/views/components/CardsSlider/ActionCard/ActionCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ActionCard { display: flex; @@ -74,7 +74,7 @@ } &.scaled-down { - transform: scale(0.85); + transform: scale(0.92); transform-origin: left; } } diff --git a/packages/commonwealth/client/scripts/views/components/CardsSlider/CardsSlider.scss b/packages/commonwealth/client/scripts/views/components/CardsSlider/CardsSlider.scss index ce308a583f4..4366784cb07 100644 --- a/packages/commonwealth/client/scripts/views/components/CardsSlider/CardsSlider.scss +++ b/packages/commonwealth/client/scripts/views/components/CardsSlider/CardsSlider.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .CardsSliderPageLayout { padding-top: 20px; @@ -12,6 +12,9 @@ display: flex; gap: 16px; flex-direction: column; + padding: 12px; + border-radius: 10px; + background-color: $primary-50; @include extraSmall { padding-top: 16px; @@ -44,6 +47,11 @@ gap: 16px; width: 100%; padding-bottom: 8px; + scrollbar-width: none; + -ms-overflow-style: none; + ::-webkit-scrollbar { + display: none; + } } } diff --git a/packages/commonwealth/client/scripts/views/components/CardsSlider/DismissModal/DismissModal.scss b/packages/commonwealth/client/scripts/views/components/CardsSlider/DismissModal/DismissModal.scss index a9a90c436e8..f5f1d7e1501 100644 --- a/packages/commonwealth/client/scripts/views/components/CardsSlider/DismissModal/DismissModal.scss +++ b/packages/commonwealth/client/scripts/views/components/CardsSlider/DismissModal/DismissModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .DismissModal { .CWModalBody { diff --git a/packages/commonwealth/client/scripts/views/components/Comments/ArchiveMsg/ArchiveMsg.scss b/packages/commonwealth/client/scripts/views/components/Comments/ArchiveMsg/ArchiveMsg.scss index 9f098dd1c13..77d43266f01 100644 --- a/packages/commonwealth/client/scripts/views/components/Comments/ArchiveMsg/ArchiveMsg.scss +++ b/packages/commonwealth/client/scripts/views/components/Comments/ArchiveMsg/ArchiveMsg.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .ArchiveMsg { background-color: $neutral-50; @@ -11,4 +11,4 @@ gap: 8px; color: $neutral-600; } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss b/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss index eb4251dd982..9b7a06cee44 100644 --- a/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss +++ b/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .CommentEditor { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/CommunityCard/NewCommunityCard.scss b/packages/commonwealth/client/scripts/views/components/CommunityCard/NewCommunityCard.scss index 208bec6fd7c..5b7393235b9 100644 --- a/packages/commonwealth/client/scripts/views/components/CommunityCard/NewCommunityCard.scss +++ b/packages/commonwealth/client/scripts/views/components/CommunityCard/NewCommunityCard.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .new-community-card.Card { height: 336px; diff --git a/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/CommunityInformationForm.scss b/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/CommunityInformationForm.scss index a21e4a75988..b5abdcac682 100644 --- a/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/CommunityInformationForm.scss +++ b/packages/commonwealth/client/scripts/views/components/CommunityInformationForm/CommunityInformationForm.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .CommunityInformationForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/CommunityStake/VoteWeightModule/VoteWeightModule.scss b/packages/commonwealth/client/scripts/views/components/CommunityStake/VoteWeightModule/VoteWeightModule.scss index 5a98a1483f8..787c30033c3 100644 --- a/packages/commonwealth/client/scripts/views/components/CommunityStake/VoteWeightModule/VoteWeightModule.scss +++ b/packages/commonwealth/client/scripts/views/components/CommunityStake/VoteWeightModule/VoteWeightModule.scss @@ -1,14 +1,13 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .VoteWeightModule { padding: 16px 24px; border-bottom: 1px solid $neutral-200; - background-color: $primary-50; .content { display: flex; flex-direction: column; - gap: 2px; + gap: 8px; .title-container { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/CosmosProposalSelector.tsx b/packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/CosmosProposalSelector.tsx index ed686e8b02b..b79f39aa57e 100644 --- a/packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/CosmosProposalSelector.tsx +++ b/packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/CosmosProposalSelector.tsx @@ -1,13 +1,13 @@ import React, { useCallback, useMemo, useState } from 'react'; -import 'components/ProposalSelector.scss'; import { CosmosProposal } from 'controllers/chain/cosmos/gov/v1beta1/proposal-v1beta1'; +import './ProposalSelector.scss'; +import { useGetAllCosmosProposals } from 'hooks/cosmos/useGetAllCosmosProposals'; import app, { ApiStatus } from 'state'; -import { CWTextInput } from 'views/components/component_kit/cw_text_input'; -import { QueryList } from 'views/components/component_kit/cw_query_list'; import { CosmosProposalSelectorItem } from 'views/components/CosmosProposalSelector'; -import { useGetAllCosmosProposals } from 'hooks/cosmos/useGetAllCosmosProposals'; +import { QueryList } from 'views/components/component_kit/cw_query_list'; +import { CWTextInput } from 'views/components/component_kit/cw_text_input'; const filterProposals = (ce: CosmosProposal, searchTerm: string) => { return ( @@ -60,7 +60,7 @@ export const CosmosProposalSelector = ({ const renderItem = useCallback( (i: number, proposal: CosmosProposal) => { const isSelected = !!proposalsToSet.find( - (el) => String(el.identifier) === proposal.identifier + (el) => String(el.identifier) === proposal.identifier, ); return ( @@ -73,7 +73,7 @@ export const CosmosProposalSelector = ({ /> ); }, - [onSelect, proposalsToSet] + [onSelect, proposalsToSet], ); if (!app.chain || !app.activeChainId()) { diff --git a/packages/commonwealth/client/styles/components/ProposalSelector.scss b/packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/ProposalSelector.scss similarity index 94% rename from packages/commonwealth/client/styles/components/ProposalSelector.scss rename to packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/ProposalSelector.scss index 23c05d006c8..cc4d336b653 100644 --- a/packages/commonwealth/client/styles/components/ProposalSelector.scss +++ b/packages/commonwealth/client/scripts/views/components/CosmosProposalSelector/ProposalSelector.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../../styles/shared.scss'; .ProposalSelector { border-radius: $border-radius-corners; diff --git a/packages/commonwealth/client/scripts/views/components/EditProfile/EditProfile.scss b/packages/commonwealth/client/scripts/views/components/EditProfile/EditProfile.scss index 5e6457ebea6..0f7b721130d 100644 --- a/packages/commonwealth/client/scripts/views/components/EditProfile/EditProfile.scss +++ b/packages/commonwealth/client/scripts/views/components/EditProfile/EditProfile.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .EditProfile { &.full-height { diff --git a/packages/commonwealth/client/scripts/views/components/EditProfile/ManageAPIKeys/ManageAPIKeys.scss b/packages/commonwealth/client/scripts/views/components/EditProfile/ManageAPIKeys/ManageAPIKeys.scss index bedfc3d1efe..76792e41a8b 100644 --- a/packages/commonwealth/client/scripts/views/components/EditProfile/ManageAPIKeys/ManageAPIKeys.scss +++ b/packages/commonwealth/client/scripts/views/components/EditProfile/ManageAPIKeys/ManageAPIKeys.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ManageAPIKeys { .flex-row { diff --git a/packages/commonwealth/client/scripts/views/components/EditProfile/Section/Section.scss b/packages/commonwealth/client/scripts/views/components/EditProfile/Section/Section.scss index 7548817bf05..4c84d8a0d21 100644 --- a/packages/commonwealth/client/scripts/views/components/EditProfile/Section/Section.scss +++ b/packages/commonwealth/client/scripts/views/components/EditProfile/Section/Section.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ProfileSection { margin-top: 24px; diff --git a/packages/commonwealth/client/scripts/views/components/ExternalLink/ExternalLink.scss b/packages/commonwealth/client/scripts/views/components/ExternalLink/ExternalLink.scss index 38bf7c22870..f69cdbce5b9 100644 --- a/packages/commonwealth/client/scripts/views/components/ExternalLink/ExternalLink.scss +++ b/packages/commonwealth/client/scripts/views/components/ExternalLink/ExternalLink.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .ExternalLink { cursor: pointer; diff --git a/packages/commonwealth/client/scripts/views/components/FeatureHint/FeatureHint.scss b/packages/commonwealth/client/scripts/views/components/FeatureHint/FeatureHint.scss index c413cdc09dd..ec13ddc55bb 100644 --- a/packages/commonwealth/client/scripts/views/components/FeatureHint/FeatureHint.scss +++ b/packages/commonwealth/client/scripts/views/components/FeatureHint/FeatureHint.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .FeatureHint { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/FractionalValue/FractionalValue.scss b/packages/commonwealth/client/scripts/views/components/FractionalValue/FractionalValue.scss index 764672a18e2..089f6839501 100644 --- a/packages/commonwealth/client/scripts/views/components/FractionalValue/FractionalValue.scss +++ b/packages/commonwealth/client/scripts/views/components/FractionalValue/FractionalValue.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .FractionalValue { height: fit-content; diff --git a/packages/commonwealth/client/scripts/views/components/LaunchIdeaCard/LaunchIdeaCard.scss b/packages/commonwealth/client/scripts/views/components/LaunchIdeaCard/LaunchIdeaCard.scss index eb6b46773c8..ee10776642e 100644 --- a/packages/commonwealth/client/scripts/views/components/LaunchIdeaCard/LaunchIdeaCard.scss +++ b/packages/commonwealth/client/scripts/views/components/LaunchIdeaCard/LaunchIdeaCard.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .LaunchIdeaCard { position: relative; diff --git a/packages/commonwealth/client/scripts/views/components/LaunchTokenCard/LaunchTokenCard.scss b/packages/commonwealth/client/scripts/views/components/LaunchTokenCard/LaunchTokenCard.scss index 87e57e7025b..02e468d82e4 100644 --- a/packages/commonwealth/client/scripts/views/components/LaunchTokenCard/LaunchTokenCard.scss +++ b/packages/commonwealth/client/scripts/views/components/LaunchTokenCard/LaunchTokenCard.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .LaunchTokenCard { background-image: url('assets/img/tokenLaunchCardBg.png'); diff --git a/packages/commonwealth/client/scripts/views/components/LinksArray/LinkItem/LinkItem.scss b/packages/commonwealth/client/scripts/views/components/LinksArray/LinkItem/LinkItem.scss index c282b59b867..ddf3b59c341 100644 --- a/packages/commonwealth/client/scripts/views/components/LinksArray/LinkItem/LinkItem.scss +++ b/packages/commonwealth/client/scripts/views/components/LinksArray/LinkItem/LinkItem.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .LinkItem { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/LinksArray/LinksArray.scss b/packages/commonwealth/client/scripts/views/components/LinksArray/LinksArray.scss index 3e1a8fcd4ed..09401175173 100644 --- a/packages/commonwealth/client/scripts/views/components/LinksArray/LinksArray.scss +++ b/packages/commonwealth/client/scripts/views/components/LinksArray/LinksArray.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .LinksArray { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/MarkdownEditor.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/MarkdownEditor.scss index 575b47acd19..9b079f8db3c 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/MarkdownEditor.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/MarkdownEditor.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; @import './layout'; html, diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/Indicator.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/Indicator.scss index 6cb8ec9ba0b..5263dd17c2b 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/Indicator.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/Indicator.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .Indicator { // cover the parent diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/TooltipIndicator.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/TooltipIndicator.scss index bcdbc47e0b4..3dfa852fc8a 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/TooltipIndicator.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/indicators/TooltipIndicator.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .TooltipIndicator { // cover the parent diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/layout.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/layout.scss index 2bc71f6b3f8..a2042cb42fe 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/layout.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/layout.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; // Basic layout for the HTML content that is rendered. diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/DesktopEditorFooter.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/DesktopEditorFooter.scss index 31db0ef0679..19b7cc31192 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/DesktopEditorFooter.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/DesktopEditorFooter.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .DesktopEditorFooter { color: $neutral-500; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FileUploadButton.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FileUploadButton.scss index 104ee17438b..fe83a7a090b 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FileUploadButton.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FileUploadButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .FileUploadButton { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FormatButton.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FormatButton.scss index 5bbcb2454af..7b03a1cce47 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FormatButton.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/FormatButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .FormatButtonActive { font-weight: bold; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/HeadingButton.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/HeadingButton.scss index fb45e70b539..6ccaedc54e6 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/HeadingButton.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/HeadingButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .HeadingButtonActive { font-weight: bold; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ListButton.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ListButton.scss index 5a365fb81ae..1bcd7807963 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ListButton.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ListButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ListButtonActive { font-weight: bold; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ToolbarForMobile.scss b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ToolbarForMobile.scss index 79e7173cd7e..99115786624 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ToolbarForMobile.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownEditor/toolbars/ToolbarForMobile.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ToolbarForMobile { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/MarkdownViewer/layout.scss b/packages/commonwealth/client/scripts/views/components/MarkdownViewer/layout.scss index 7dfc368486e..9186b728e52 100644 --- a/packages/commonwealth/client/scripts/views/components/MarkdownViewer/layout.scss +++ b/packages/commonwealth/client/scripts/views/components/MarkdownViewer/layout.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; // Basic layout for the HTML content that is rendered. diff --git a/packages/commonwealth/client/scripts/views/components/Mava/Mava.scss b/packages/commonwealth/client/scripts/views/components/Mava/Mava.scss index 749499150b7..0ba1b9a37f7 100644 --- a/packages/commonwealth/client/scripts/views/components/Mava/Mava.scss +++ b/packages/commonwealth/client/scripts/views/components/Mava/Mava.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/mixins/breakpoints.module'; +@import '../../../styles/mixins/breakpoints.module'; #mava { .loadButton { diff --git a/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx b/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx index dc90a03c52e..274062c7164 100644 --- a/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx +++ b/packages/commonwealth/client/scripts/views/components/MetaTags/MetaTags.tsx @@ -1,6 +1,6 @@ -import 'Layout.scss'; import React from 'react'; import { Helmet } from 'react-helmet-async'; +import '../../Layout.scss'; type MetaTagName = | 'application-name' diff --git a/packages/commonwealth/client/scripts/views/components/MobileNavigation/CreateContentDrawer/CreateContentDrawer.scss b/packages/commonwealth/client/scripts/views/components/MobileNavigation/CreateContentDrawer/CreateContentDrawer.scss index 83c2032dc7d..290f1d874b2 100644 --- a/packages/commonwealth/client/scripts/views/components/MobileNavigation/CreateContentDrawer/CreateContentDrawer.scss +++ b/packages/commonwealth/client/scripts/views/components/MobileNavigation/CreateContentDrawer/CreateContentDrawer.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .CreateContentDrawer { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/MobileNavigation/MobileNavigation.scss b/packages/commonwealth/client/scripts/views/components/MobileNavigation/MobileNavigation.scss index 27f7bcc0885..b187ee5f6c4 100644 --- a/packages/commonwealth/client/scripts/views/components/MobileNavigation/MobileNavigation.scss +++ b/packages/commonwealth/client/scripts/views/components/MobileNavigation/MobileNavigation.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .MobileNavigation { border-top: 1px solid $neutral-200; diff --git a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss index 9fd946f4a03..78fdfd9cbb2 100644 --- a/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss +++ b/packages/commonwealth/client/scripts/views/components/MobileNavigation/NavigationButton/NavigationButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .NavigationButton { cursor: pointer; diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestThreadBanner/ContestThreadBanner.scss b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestThreadBanner/ContestThreadBanner.scss index cf8929dd46e..cece8ea2b4d 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestThreadBanner/ContestThreadBanner.scss +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestThreadBanner/ContestThreadBanner.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ContestThreadBanner { .content-container { diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestTopicBanner/ContestTopicBanner.scss b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestTopicBanner/ContestTopicBanner.scss index ae9ab7d0774..81578db3c70 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestTopicBanner/ContestTopicBanner.scss +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/ContestTopicBanner/ContestTopicBanner.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ContestTopicBanner { .body { diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/NewThreadForm.scss b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/NewThreadForm.scss index 915ef1942b0..2318d3c4223 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/NewThreadForm.scss +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/NewThreadForm.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .NewThreadForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/helpers/useNewThreadForm.ts b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/helpers/useNewThreadForm.ts index a55c52e5f32..eaa5ebc4e9d 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/helpers/useNewThreadForm.ts +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormLegacy/helpers/useNewThreadForm.ts @@ -88,7 +88,7 @@ const useNewThreadForm = (communityId: string, topicsForSelector: Topic[]) => { if (!threadContentDelta && threadTopic?.default_offchain_template) { try { const template = JSON.parse( - threadTopic.default_offchain_template, + decodeURIComponent(threadTopic.default_offchain_template), ) as DeltaStatic; setThreadContentDelta(template); } catch (e) { diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestThreadBanner/ContestThreadBanner.scss b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestThreadBanner/ContestThreadBanner.scss index cf8929dd46e..cece8ea2b4d 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestThreadBanner/ContestThreadBanner.scss +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestThreadBanner/ContestThreadBanner.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ContestThreadBanner { .content-container { diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestTopicBanner/ContestTopicBanner.scss b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestTopicBanner/ContestTopicBanner.scss index ae9ab7d0774..81578db3c70 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestTopicBanner/ContestTopicBanner.scss +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/ContestTopicBanner/ContestTopicBanner.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ContestTopicBanner { .body { diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/NewThreadForm.scss b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/NewThreadForm.scss index 915ef1942b0..2318d3c4223 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/NewThreadForm.scss +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/NewThreadForm.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .NewThreadForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/helpers/useNewThreadForm.ts b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/helpers/useNewThreadForm.ts index 32eadb7a1d6..b17853c0282 100644 --- a/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/helpers/useNewThreadForm.ts +++ b/packages/commonwealth/client/scripts/views/components/NewThreadFormModern/helpers/useNewThreadForm.ts @@ -85,7 +85,7 @@ const useNewThreadForm = (communityId: string, topicsForSelector: Topic[]) => { if (!editorText && threadTopic?.default_offchain_template) { try { const template = JSON.parse( - threadTopic.default_offchain_template, + decodeURIComponent(threadTopic.default_offchain_template), ) as string; setEditorText(template); } catch (e) { diff --git a/packages/commonwealth/client/scripts/views/components/NumberSelector/NumberSelector.scss b/packages/commonwealth/client/scripts/views/components/NumberSelector/NumberSelector.scss index e309e83134f..f43f66183c7 100644 --- a/packages/commonwealth/client/scripts/views/components/NumberSelector/NumberSelector.scss +++ b/packages/commonwealth/client/scripts/views/components/NumberSelector/NumberSelector.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .NumberSelector { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/PageCounter/PageCounter.scss b/packages/commonwealth/client/scripts/views/components/PageCounter/PageCounter.scss index 4933a8e6ca0..caa0bec4840 100644 --- a/packages/commonwealth/client/scripts/views/components/PageCounter/PageCounter.scss +++ b/packages/commonwealth/client/scripts/views/components/PageCounter/PageCounter.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .PageCounter { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Polls/CastVoteSection/CastVoteSection.scss b/packages/commonwealth/client/scripts/views/components/Polls/CastVoteSection/CastVoteSection.scss index 21978a6bf2d..0df0278eb3f 100644 --- a/packages/commonwealth/client/scripts/views/components/Polls/CastVoteSection/CastVoteSection.scss +++ b/packages/commonwealth/client/scripts/views/components/Polls/CastVoteSection/CastVoteSection.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .CastVoteSection { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/Polls/DeletePollModal/DeletePollModal.scss b/packages/commonwealth/client/scripts/views/components/Polls/DeletePollModal/DeletePollModal.scss index cf306745643..604ee6872f8 100644 --- a/packages/commonwealth/client/scripts/views/components/Polls/DeletePollModal/DeletePollModal.scss +++ b/packages/commonwealth/client/scripts/views/components/Polls/DeletePollModal/DeletePollModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .DeletePollModal { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/components/Polls/PollCard/PollCard.scss b/packages/commonwealth/client/scripts/views/components/Polls/PollCard/PollCard.scss index cec048db3b2..ae7804b0493 100644 --- a/packages/commonwealth/client/scripts/views/components/Polls/PollCard/PollCard.scss +++ b/packages/commonwealth/client/scripts/views/components/Polls/PollCard/PollCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .PollCard.Card { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/Polls/PollOptions/PollOptions.scss b/packages/commonwealth/client/scripts/views/components/Polls/PollOptions/PollOptions.scss index a00b64a9703..3faec5dcb1d 100644 --- a/packages/commonwealth/client/scripts/views/components/Polls/PollOptions/PollOptions.scss +++ b/packages/commonwealth/client/scripts/views/components/Polls/PollOptions/PollOptions.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .PollOptions { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Polls/ResultsSections/ResultsSections.scss b/packages/commonwealth/client/scripts/views/components/Polls/ResultsSections/ResultsSections.scss index 95114805250..c5a918e1501 100644 --- a/packages/commonwealth/client/scripts/views/components/Polls/ResultsSections/ResultsSections.scss +++ b/packages/commonwealth/client/scripts/views/components/Polls/ResultsSections/ResultsSections.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ResultsSections { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Polls/VoteDisplay/VoteDisplay.scss b/packages/commonwealth/client/scripts/views/components/Polls/VoteDisplay/VoteDisplay.scss index e50fb46693d..132bea16052 100644 --- a/packages/commonwealth/client/scripts/views/components/Polls/VoteDisplay/VoteDisplay.scss +++ b/packages/commonwealth/client/scripts/views/components/Polls/VoteDisplay/VoteDisplay.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .VoteDisplay { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/PreferenceTags/PreferenceTags.scss b/packages/commonwealth/client/scripts/views/components/PreferenceTags/PreferenceTags.scss index c143077c796..ec9ea8cb2a0 100644 --- a/packages/commonwealth/client/scripts/views/components/PreferenceTags/PreferenceTags.scss +++ b/packages/commonwealth/client/scripts/views/components/PreferenceTags/PreferenceTags.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .PreferenceTags { display: flex; diff --git a/packages/commonwealth/client/styles/components/Profile/Profile.scss b/packages/commonwealth/client/scripts/views/components/Profile/Profile.scss similarity index 96% rename from packages/commonwealth/client/styles/components/Profile/Profile.scss rename to packages/commonwealth/client/scripts/views/components/Profile/Profile.scss index f0204d1d740..5af95b7205a 100644 --- a/packages/commonwealth/client/styles/components/Profile/Profile.scss +++ b/packages/commonwealth/client/scripts/views/components/Profile/Profile.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Profile { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx b/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx index 95ef2a2b364..316b7398963 100644 --- a/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx +++ b/packages/commonwealth/client/scripts/views/components/Profile/Profile.tsx @@ -1,5 +1,4 @@ import { DEFAULT_NAME } from '@hicommonwealth/shared'; -import 'components/Profile/Profile.scss'; import React, { useEffect, useState } from 'react'; import { Helmet } from 'react-helmet-async'; import { useFetchProfileByIdQuery } from 'state/api/profiles'; @@ -11,6 +10,7 @@ import { CWText } from '../../components/component_kit/cw_text'; import { PageNotFound } from '../../pages/404'; import { ImageBehavior } from '../component_kit/CWImageInput'; import CWCircleMultiplySpinner from '../component_kit/new_designs/CWCircleMultiplySpinner'; +import './Profile.scss'; import type { CommentWithAssociatedThread } from './ProfileActivity'; import ProfileActivity from './ProfileActivity'; import ProfileHeader from './ProfileHeader'; @@ -139,7 +139,11 @@ const Profile = ({ userId }: ProfileProps) => { > {/* @ts-expect-error StrictNullChecks*/} - + @@ -151,7 +155,11 @@ const Profile = ({ userId }: ProfileProps) => {
{/* @ts-expect-error StrictNullChecks*/} - +
diff --git a/packages/commonwealth/client/styles/components/Profile/ProfileActivity.scss b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.scss similarity index 96% rename from packages/commonwealth/client/styles/components/Profile/ProfileActivity.scss rename to packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.scss index 9f6bc592a9a..54dfcb5303a 100644 --- a/packages/commonwealth/client/styles/components/Profile/ProfileActivity.scss +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProfileActivity { border: 1px solid $neutral-200; @@ -17,6 +17,7 @@ .CWTabsRow { align-items: center; + overflow: auto; .tab-header { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.tsx b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.tsx index 59f5553fda2..b8462d0efb4 100644 --- a/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.tsx +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivity.tsx @@ -1,19 +1,15 @@ import React, { useState } from 'react'; -import 'components/Profile/ProfileActivity.scss'; +import './ProfileActivity.scss'; +import { useFlag } from 'hooks/useFlag'; import type Comment from 'models/Comment'; import type Thread from 'models/Thread'; import type { IUniqueId } from 'models/interfaces'; import { CWTab, CWTabsRow } from '../component_kit/new_designs/CWTabs'; -import ProfileActivityContent from './ProfileActivityContent'; - -enum ProfileActivityType { - Addresses, - Comments, - Communities, - Threads, -} +import ProfileActivityContent, { + ProfileActivityType, +} from './ProfileActivityContent'; export type CommentWithAssociatedThread = Comment & { thread: Thread; @@ -22,13 +18,20 @@ export type CommentWithAssociatedThread = Comment & { type ProfileActivityProps = { comments: CommentWithAssociatedThread[]; threads: Thread[]; + isOwner: boolean | undefined; }; -const ProfileActivity = ({ comments, threads }: ProfileActivityProps) => { +const ProfileActivity = ({ + comments, + threads, + isOwner, +}: ProfileActivityProps) => { const [selectedActivity, setSelectedActivity] = useState( ProfileActivityType.Comments, ); + const referralsEnabled = useFlag('referrals'); + return (
@@ -52,6 +55,20 @@ const ProfileActivity = ({ comments, threads }: ProfileActivityProps) => { }} isSelected={selectedActivity === ProfileActivityType.Threads} /> + {referralsEnabled && ( + + Referrals +
5
+
+ } + onClick={() => { + setSelectedActivity(ProfileActivityType.Referrals); + }} + /> + )}
@@ -59,6 +76,7 @@ const ProfileActivity = ({ comments, threads }: ProfileActivityProps) => { option={selectedActivity} threads={threads} comments={comments} + isOwner={isOwner} />
diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityContent.tsx b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityContent.tsx index 553a51cc2d6..10bc51380d3 100644 --- a/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityContent.tsx +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityContent.tsx @@ -1,29 +1,33 @@ import React from 'react'; -import 'components/Profile/Profile.scss'; +import './Profile.scss'; import type Thread from 'models/Thread'; import { CWText } from '../component_kit/cw_text'; import type { CommentWithAssociatedThread } from './ProfileActivity'; import ProfileActivityRow from './ProfileActivityRow'; +import ReferralsTab from './ReferralsTab'; -enum ProfileActivityType { +export enum ProfileActivityType { Addresses, Comments, Communities, Threads, + Referrals, } type ProfileActivityContentProps = { option: ProfileActivityType; threads: Thread[]; comments: CommentWithAssociatedThread[]; + isOwner: boolean | undefined; }; const ProfileActivityContent = ({ option, comments, threads, + isOwner, }: ProfileActivityContentProps) => { if (option === ProfileActivityType.Threads) { if (threads.length === 0) { @@ -49,6 +53,10 @@ const ProfileActivityContent = ({ ); } + if (option === ProfileActivityType.Referrals) { + return ; + } + const allActivities: Array = [ ...comments, ...threads, diff --git a/packages/commonwealth/client/styles/components/Profile/ProfileActivityRow.scss b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.scss similarity index 96% rename from packages/commonwealth/client/styles/components/Profile/ProfileActivityRow.scss rename to packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.scss index 37bdc0c5531..ba3b6864723 100644 --- a/packages/commonwealth/client/styles/components/Profile/ProfileActivityRow.scss +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProfileActivityRow { position: relative; diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.tsx b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.tsx index 672a59dccc3..2405c19ba6f 100644 --- a/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.tsx +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileActivityRow.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import 'components/Profile/ProfileActivityRow.scss'; import moment from 'moment'; +import './ProfileActivityRow.scss'; import Thread from 'models/Thread'; import withRouter, { diff --git a/packages/commonwealth/client/styles/components/Profile/ProfileHeader.scss b/packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.scss similarity index 74% rename from packages/commonwealth/client/styles/components/Profile/ProfileHeader.scss rename to packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.scss index 6d7ccfb0d52..16d60e95d67 100644 --- a/packages/commonwealth/client/styles/components/Profile/ProfileHeader.scss +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProfileHeader { border: 1px solid $neutral-200; @@ -34,9 +34,28 @@ } .profile-name-and-bio { + display: flex; + flex-direction: column; + + .btn-border { + margin-inline: auto; + .referral-link-button { + margin-inline: auto; + + .Text { + font-weight: 400 !important; + } + } + } + .bio { margin-top: 16px; } + .icon-container { + display: flex; + flex-direction: row; + justify-content: center; + } .buttons { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.tsx b/packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.tsx index 166817edd57..fd4a89ddfe9 100644 --- a/packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.tsx +++ b/packages/commonwealth/client/scripts/views/components/Profile/ProfileHeader.tsx @@ -2,17 +2,20 @@ import jdenticon from 'jdenticon'; import React from 'react'; import { useNavigate } from 'react-router-dom'; -import 'components/Profile/ProfileHeader.scss'; +import './ProfileHeader.scss'; import { DEFAULT_NAME, getDecodedString, renderQuillDeltaToText, } from '@hicommonwealth/shared'; +import { useFlag } from 'hooks/useFlag'; +import { useInviteLinkModal } from 'state/ui/modals'; import useUserStore from 'state/ui/user'; import { MarkdownViewerWithFallback } from 'views/components/MarkdownViewerWithFallback/MarkdownViewerWithFallback'; import { CWButton } from 'views/components/component_kit/new_designs/CWButton'; import type NewProfile from '../../../models/NewProfile'; +import { SharePopover } from '../SharePopover'; import { CWText } from '../component_kit/cw_text'; import { SocialAccounts } from '../social_accounts'; @@ -24,6 +27,8 @@ type ProfileHeaderProps = { const ProfileHeader = ({ profile, isOwner }: ProfileHeaderProps) => { const navigate = useNavigate(); const user = useUserStore(); + const { setIsInviteLinkModalOpen } = useInviteLinkModal(); + const referralsEnabled = useFlag('referrals'); if (!profile) return; const { bio, name } = profile; @@ -63,10 +68,23 @@ const ProfileHeader = ({ profile, isOwner }: ProfileHeaderProps) => { )}
- + {name || DEFAULT_NAME} - + + {referralsEnabled && isCurrentUser && ( + setIsInviteLinkModalOpen(true)} + /> + )} +
+ + +
{hasBio() && (
Bio diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/ReferralsTab.scss b/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/ReferralsTab.scss new file mode 100644 index 00000000000..65567e34a74 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/ReferralsTab.scss @@ -0,0 +1,57 @@ +@import '../../../../styles/shared.scss'; + +.ReferralsTab { + display: flex; + flex-direction: column; + gap: 24px; + + input, + svg { + cursor: pointer !important; + } + + input:read-only { + background-color: $neutral-50; + border-color: $neutral-200; + color: $neutral-400; + + &:hover { + border-color: $neutral-200; + } + + &:focus-within { + border-color: $neutral-200 !important; + box-shadow: none !important; + } + } + + table { + width: 100%; + @include table-cell; + } + + .referral-totals { + margin-right: 16px; + display: flex; + justify-content: flex-end; + gap: 8px; + align-items: center; + } + + .empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 176px 0; + + @include mediumSmallInclusive { + padding: 96px 0; + } + + .empty-state-text { + color: $neutral-400; + text-align: center; + } + } +} diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/ReferralsTab.tsx b/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/ReferralsTab.tsx new file mode 100644 index 00000000000..d1ea219d006 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/ReferralsTab.tsx @@ -0,0 +1,186 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; + +import { useUserStore } from 'state/ui/user/user'; +import { saveToClipboard } from 'utils/clipboard'; + +import { APIOrderDirection } from 'helpers/constants'; +import { Avatar } from '../../Avatar'; +import { CWIcon } from '../../component_kit/cw_icons/cw_icon'; +import { CWText } from '../../component_kit/cw_text'; +import CWIconButton from '../../component_kit/new_designs/CWIconButton'; +import CWPopover, { + usePopover, +} from '../../component_kit/new_designs/CWPopover'; +import { CWTable } from '../../component_kit/new_designs/CWTable'; +import { CWTableColumnInfo } from '../../component_kit/new_designs/CWTable/CWTable'; +import { useCWTableState } from '../../component_kit/new_designs/CWTable/useCWTableState'; +import { CWTextInput } from '../../component_kit/new_designs/CWTextInput'; + +import './ReferralsTab.scss'; + +const fakeData = [ + { + user: { + name: 'cambell', + avatarUrl: + 'https://assets.commonwealth.im/794bb7a3-17d7-407a-b52e-2987501221b5.png', + userId: '128606', + address: 'address1', + }, + earnings: '5.3', + }, + { + user: { + name: 'adam', + avatarUrl: + 'https://assets.commonwealth.im/0847e7f5-4d96-4406-8f30-c3082fa2f27c.png', + userId: '135099', + address: 'address2', + }, + earnings: '1.9', + }, + { + user: { + name: 'mike', + avatarUrl: + 'https://assets.commonwealth.im/181e25ad-ce08-427d-8d3a-d290af3be44b.png', + userId: '158139', + address: 'address3', + }, + earnings: '0.1', + }, +]; + +const columns: CWTableColumnInfo[] = [ + { + key: 'member', + header: 'Member', + numeric: false, + sortable: true, + }, + + { + key: 'earnings', + header: 'Earnings', + numeric: true, + sortable: true, + }, +]; + +interface ReferralsTabProps { + isOwner: boolean | undefined; +} + +const ReferralsTab = ({ isOwner }: ReferralsTabProps) => { + const user = useUserStore(); + const popoverProps = usePopover(); + + const tableState = useCWTableState({ + columns, + initialSortColumn: 'earnings', + initialSortDirection: APIOrderDirection.Desc, + }); + + // TODO: replace with actual invite link from backend in upcoming PR + const inviteLink = 'https://commonwealth.im/~/invite/774037=89defcb8'; + + const handleCopy = () => { + saveToClipboard(inviteLink, true).catch(console.error); + }; + + const isCurrentUser = user.isLoggedIn && isOwner; + + return ( +
+ {isCurrentUser && ( + } + /> + )} + + {fakeData.length > 0 ? ( + <> + ({ + ...item, + member: { + sortValue: item.user.name.toLowerCase(), + customElement: ( +
+ + +

{item.user.name}

+ +
+ ), + }, + earnings: { + sortValue: item.earnings, + customElement: ( +
+ USD {item.earnings} +
+ ), + }, + }))} + /> +
+ + Total + + USD 10.30 + + <> + + + Earnings are generated when a referred user makes a + transaction on the platform. 20% of the fees from each + transaction are shared with the referrer. + + } + {...popoverProps} + /> + +
+ + ) : ( +
+ + You currently have no referrals. + + + Refer your friends to earn rewards. + +
+ )} +
+ ); +}; + +export default ReferralsTab; diff --git a/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/index.ts b/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/index.ts new file mode 100644 index 00000000000..e3a7c26971d --- /dev/null +++ b/packages/commonwealth/client/scripts/views/components/Profile/ReferralsTab/index.ts @@ -0,0 +1,3 @@ +import ReferralsTab from './ReferralsTab'; + +export default ReferralsTab; diff --git a/packages/commonwealth/client/styles/components/ProposalCard/ProposalCard.scss b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.scss similarity index 94% rename from packages/commonwealth/client/styles/components/ProposalCard/ProposalCard.scss rename to packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.scss index 21966c9dd3a..1b63af2ad93 100644 --- a/packages/commonwealth/client/styles/components/ProposalCard/ProposalCard.scss +++ b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProposalCard.Card { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.tsx b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.tsx index 88ed9dbf76c..4622d3c120d 100644 --- a/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.tsx +++ b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalCard.tsx @@ -1,8 +1,8 @@ import React, { useEffect, useState } from 'react'; -import 'components/ProposalCard/ProposalCard.scss'; import { getProposalUrlPath } from 'identifiers'; import type { AnyProposal } from '../../../models/types'; +import './ProposalCard.scss'; import { slugify } from '@hicommonwealth/shared'; import { useCommonNavigate } from 'navigation/helpers'; diff --git a/packages/commonwealth/client/styles/components/ProposalCard/ProposalTag.scss b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.scss similarity index 78% rename from packages/commonwealth/client/styles/components/ProposalCard/ProposalTag.scss rename to packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.scss index 615e6b831ae..b05c8d660e8 100644 --- a/packages/commonwealth/client/styles/components/ProposalCard/ProposalTag.scss +++ b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProposalTag.Text { background-color: $neutral-100; diff --git a/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.tsx b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.tsx index 612f4e3e596..50e63445665 100644 --- a/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.tsx +++ b/packages/commonwealth/client/scripts/views/components/ProposalCard/ProposalTag.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/ProposalCard/ProposalTag.scss'; +import './ProposalTag.scss'; import { CWText } from '../component_kit/cw_text'; diff --git a/packages/commonwealth/client/scripts/views/components/ProposalCard/helpers.tsx b/packages/commonwealth/client/scripts/views/components/ProposalCard/helpers.tsx index 8f128728de1..92b6dee877c 100644 --- a/packages/commonwealth/client/scripts/views/components/ProposalCard/helpers.tsx +++ b/packages/commonwealth/client/scripts/views/components/ProposalCard/helpers.tsx @@ -1,5 +1,5 @@ -import 'components/ProposalCard/ProposalCard.scss'; import React from 'react'; +import './ProposalCard.scss'; import { blocknumToDuration, diff --git a/packages/commonwealth/client/scripts/views/components/ScrollContainer/OverflowIndicator.scss b/packages/commonwealth/client/scripts/views/components/ScrollContainer/OverflowIndicator.scss index 44f68d88145..113c004e72e 100644 --- a/packages/commonwealth/client/scripts/views/components/ScrollContainer/OverflowIndicator.scss +++ b/packages/commonwealth/client/scripts/views/components/ScrollContainer/OverflowIndicator.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .OverflowIndicator { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/Select/Option.scss b/packages/commonwealth/client/scripts/views/components/Select/Option.scss index 70f1a3ffd9c..db4c0c2fed8 100644 --- a/packages/commonwealth/client/scripts/views/components/Select/Option.scss +++ b/packages/commonwealth/client/scripts/views/components/Select/Option.scss @@ -1,36 +1,36 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .select-option { - gap: 8px; - display: flex; - max-width: 34ch; - cursor: pointer; - overflow: hidden; - white-space: nowrap; - align-items: center; - flex-direction: row; - text-overflow: ellipsis; - height: auto !important; - border-radius: $border-radius-md !important; - font-size: 14px !important; - min-height: 40px; - line-height: 20px; - letter-spacing: 1%; + gap: 8px; + display: flex; + max-width: 34ch; + cursor: pointer; + overflow: hidden; + white-space: nowrap; + align-items: center; + flex-direction: row; + text-overflow: ellipsis; + height: auto !important; + border-radius: $border-radius-md !important; + font-size: 14px !important; + min-height: 40px; + line-height: 20px; + letter-spacing: 1%; - &.size-default { - padding: 10px 12px !important; - } + &.size-default { + padding: 10px 12px !important; + } - &.size-compact { - padding: 6px 12px !important; - } + &.size-compact { + padding: 6px 12px !important; + } - &:hover, - &:active { - background-color: $neutral-100; - } + &:hover, + &:active { + background-color: $neutral-100; + } - &.isSelected { - background-color: $neutral-50; - } -} \ No newline at end of file + &.isSelected { + background-color: $neutral-50; + } +} diff --git a/packages/commonwealth/client/scripts/views/components/Select/Select.scss b/packages/commonwealth/client/scripts/views/components/Select/Select.scss index 36948415365..5141a5b3834 100644 --- a/packages/commonwealth/client/scripts/views/components/Select/Select.scss +++ b/packages/commonwealth/client/scripts/views/components/Select/Select.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .btn-border:has(.Select) { border: none; diff --git a/packages/commonwealth/client/scripts/views/components/SharePopover/SharePopover.tsx b/packages/commonwealth/client/scripts/views/components/SharePopover/SharePopover.tsx index 554bc6018fd..3be4792ba97 100644 --- a/packages/commonwealth/client/scripts/views/components/SharePopover/SharePopover.tsx +++ b/packages/commonwealth/client/scripts/views/components/SharePopover/SharePopover.tsx @@ -1,3 +1,4 @@ +import { notifySuccess } from 'client/scripts/controllers/app/notifications'; import React from 'react'; import { PopoverMenu } from 'views/components/component_kit/CWPopoverMenu'; import { PopoverTriggerProps } from 'views/components/component_kit/new_designs/CWPopover'; @@ -39,7 +40,9 @@ export const SharePopover = ({ onClick: () => { navigator.clipboard .writeText(linkToShare) - .then() + .then(() => { + notifySuccess('Successfully copied! '); + }) .catch(console.error); }, }, diff --git a/packages/commonwealth/client/scripts/views/components/Skeleton/Skeleton.scss b/packages/commonwealth/client/scripts/views/components/Skeleton/Skeleton.scss index dcc7b1e2d0f..ac534049dad 100644 --- a/packages/commonwealth/client/scripts/views/components/Skeleton/Skeleton.scss +++ b/packages/commonwealth/client/scripts/views/components/Skeleton/Skeleton.scss @@ -1,5 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .skeleton { - -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss index 5efec9a279a..2e6527b0f80 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/DesktopHeader.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .DesktopHeader { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.scss b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.scss index 33b8cb569cf..314c5dffcb7 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.scss +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .UserDropdown { width: 256px; diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.tsx b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.tsx index e35aa17bf94..0dd1a3977f0 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.tsx +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/DesktopHeader/UserDropdown/UserDropdown.tsx @@ -1,13 +1,14 @@ import clsx from 'clsx'; import React, { useState } from 'react'; +import useInviteLinkModal from 'state/ui/modals/inviteLinkModal'; +import useUserStore from 'state/ui/user'; import { PopoverMenu } from 'views/components/component_kit/CWPopoverMenu'; import { CWIcon } from 'views/components/component_kit/cw_icons/cw_icon'; import { User } from 'views/components/user/user'; import useUserMenuItems from '../../useUserMenuItems'; -import useUserStore from 'state/ui/user'; import './UserDropdown.scss'; interface UserDropdownProps { @@ -16,10 +17,12 @@ interface UserDropdownProps { const UserDropdown = ({ onAuthModalOpen }: UserDropdownProps) => { const [isOpen, setIsOpen] = useState(false); + const { setIsInviteLinkModalOpen } = useInviteLinkModal(); const { userMenuItems } = useUserMenuItems({ onAuthModalOpen, isMenuOpen: isOpen, + onReferralItemClick: () => setIsInviteLinkModalOpen(true), }); const userData = useUserStore(); diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/GrowlTemplate/CWGrowlTemplate.scss b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/GrowlTemplate/CWGrowlTemplate.scss index 74c433cccf2..0704e367576 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/GrowlTemplate/CWGrowlTemplate.scss +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/GrowlTemplate/CWGrowlTemplate.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .CWGrowlTemplate { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.scss b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.scss index 56563049d8b..551b5dbfc07 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.scss +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .MobileHeader { height: 48px; @@ -53,3 +53,25 @@ } } } + +.InviteLinkDrawer { + padding: 0 !important; + + .CWModalHeader { + padding: 24px 16px !important; + } + + .CWModalBody { + padding-inline: 16px !important; + + .share-section { + .bold { + margin: 0 !important; + } + } + } + + .CWModalFooter { + padding: 0 !important; + } +} diff --git a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx index 137ad273f9c..a0351a87776 100644 --- a/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx +++ b/packages/commonwealth/client/scripts/views/components/SublayoutHeader/MobileHeader/MobileHeader.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; +import { useInviteLinkModal } from 'state/ui/modals'; import useSidebarStore from 'state/ui/sidebar'; - +import useUserStore from 'state/ui/user'; import { PopoverMenuItem } from 'views/components/component_kit/CWPopoverMenu'; import MenuContent from 'views/components/component_kit/CWPopoverMenu/MenuContent'; import { CWIconButton } from 'views/components/component_kit/cw_icon_button'; @@ -10,12 +11,12 @@ import CWDrawer from 'views/components/component_kit/new_designs/CWDrawer'; import { CWModal } from 'views/components/component_kit/new_designs/CWModal'; import CollapsableSidebarButton from 'views/components/sidebar/CollapsableSidebarButton'; import { User } from 'views/components/user/user'; +import { AuthModalType } from 'views/modals/AuthModal'; +import InviteLinkModal from 'views/modals/InviteLinkModal'; import MobileSearchModal from 'views/modals/MobileSearchModal'; import useUserMenuItems from '../useUserMenuItems'; -import useUserStore from 'state/ui/user'; -import { AuthModalType } from 'views/modals/AuthModal'; import './MobileHeader.scss'; interface MobileHeaderProps { @@ -34,6 +35,8 @@ const MobileHeader = ({ const { menuVisible } = useSidebarStore(); const userData = useUserStore(); const user = userData.addresses?.[0]; + const { isInviteLinkModalOpen, setIsInviteLinkModalOpen } = + useInviteLinkModal(); const magnifyingGlassVisible = true; const shouldShowCollapsableSidebarButton = isInsideCommunity @@ -44,6 +47,10 @@ const MobileHeader = ({ onAuthModalOpen, isMenuOpen: isUserDrawerOpen, onAddressItemClick: () => setIsUserDrawerOpen(false), + onReferralItemClick: () => { + setIsUserDrawerOpen(false); + setIsInviteLinkModalOpen(true); + }, }); const mobileItems = [ @@ -120,6 +127,23 @@ const MobileHeader = ({
+ { + setIsInviteLinkModalOpen(false); + }} + > + { + setIsInviteLinkModalOpen(false); + }} + /> + + void; isMenuOpen: boolean; onAddressItemClick?: () => void; + onReferralItemClick?: () => void; } const useUserMenuItems = ({ onAuthModalOpen, isMenuOpen, onAddressItemClick, + onReferralItemClick, }: UseUserMenuItemsProps) => { const [isDarkModeOn, setIsDarkModeOn] = useState( localStorage.getItem('dark-mode-state') === 'on', @@ -84,6 +89,8 @@ const useUserMenuItems = ({ recheck: isMenuOpen, }); + const referralsEnabled = useFlag('referrals'); + const userData = useUserStore(); const hasMagic = userData.addresses?.[0]?.walletId === WalletId.Magic; @@ -275,6 +282,14 @@ const useUserMenuItems = ({
), onClick: () => openMagicWallet(), + ...(referralsEnabled + ? [ + { + type: 'default', + label: 'Get referral link', + onClick: () => { + onReferralItemClick?.(); + }, }, ] : []), diff --git a/packages/commonwealth/client/scripts/views/components/ThreadContestTag/ThreadContestTag.scss b/packages/commonwealth/client/scripts/views/components/ThreadContestTag/ThreadContestTag.scss index a59bb98d482..3eac0a645f8 100644 --- a/packages/commonwealth/client/scripts/views/components/ThreadContestTag/ThreadContestTag.scss +++ b/packages/commonwealth/client/scripts/views/components/ThreadContestTag/ThreadContestTag.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .ThreadContestTag { display: inline-block; diff --git a/packages/commonwealth/client/scripts/views/components/TokenBanner/TokenBanner.scss b/packages/commonwealth/client/scripts/views/components/TokenBanner/TokenBanner.scss index e705fbd7f65..02c78e3117a 100644 --- a/packages/commonwealth/client/scripts/views/components/TokenBanner/TokenBanner.scss +++ b/packages/commonwealth/client/scripts/views/components/TokenBanner/TokenBanner.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .TokenBanner { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/TokenCard/MarketCapProgress.scss b/packages/commonwealth/client/scripts/views/components/TokenCard/MarketCapProgress.scss index c3e6905654e..a14e38f362c 100644 --- a/packages/commonwealth/client/scripts/views/components/TokenCard/MarketCapProgress.scss +++ b/packages/commonwealth/client/scripts/views/components/TokenCard/MarketCapProgress.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .MarketCapProgress { padding: 8px; diff --git a/packages/commonwealth/client/scripts/views/components/TokenCard/PricePercentageChange.scss b/packages/commonwealth/client/scripts/views/components/TokenCard/PricePercentageChange.scss index 2cd720eb515..e17b061ed6a 100644 --- a/packages/commonwealth/client/scripts/views/components/TokenCard/PricePercentageChange.scss +++ b/packages/commonwealth/client/scripts/views/components/TokenCard/PricePercentageChange.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .PricePercentageChange { width: fit-content; diff --git a/packages/commonwealth/client/scripts/views/components/TokenCard/TokenCard.scss b/packages/commonwealth/client/scripts/views/components/TokenCard/TokenCard.scss index 02f243f0e8b..3c17127d9f9 100644 --- a/packages/commonwealth/client/scripts/views/components/TokenCard/TokenCard.scss +++ b/packages/commonwealth/client/scripts/views/components/TokenCard/TokenCard.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .TokenCard { border-radius: $border-radius-corners; diff --git a/packages/commonwealth/client/scripts/views/components/UpvoteDrawer/ViewUpvotesDrawer/ViewUpvotesDrawer.scss b/packages/commonwealth/client/scripts/views/components/UpvoteDrawer/ViewUpvotesDrawer/ViewUpvotesDrawer.scss index 2b4c62a0023..36f9300a32b 100644 --- a/packages/commonwealth/client/scripts/views/components/UpvoteDrawer/ViewUpvotesDrawer/ViewUpvotesDrawer.scss +++ b/packages/commonwealth/client/scripts/views/components/UpvoteDrawer/ViewUpvotesDrawer/ViewUpvotesDrawer.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .ViewUpvotesDrawer { .Drawer.upvote-drawer { diff --git a/packages/commonwealth/client/scripts/views/components/UpvotePopover/UpvotePopover.scss b/packages/commonwealth/client/scripts/views/components/UpvotePopover/UpvotePopover.scss index 1a05d68c626..c38205ddb3e 100644 --- a/packages/commonwealth/client/scripts/views/components/UpvotePopover/UpvotePopover.scss +++ b/packages/commonwealth/client/scripts/views/components/UpvotePopover/UpvotePopover.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .Popover.UpvotePopover { padding: 8px 0; diff --git a/packages/commonwealth/client/styles/components/UrlLinkSelector.scss b/packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlLinkSelector.scss similarity index 95% rename from packages/commonwealth/client/styles/components/UrlLinkSelector.scss rename to packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlLinkSelector.scss index 2a4683f6aa5..1e109655325 100644 --- a/packages/commonwealth/client/styles/components/UrlLinkSelector.scss +++ b/packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlLinkSelector.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../../styles/shared.scss'; .UrlLinkSelector { border-radius: $border-radius-corners; diff --git a/packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlSelector.tsx b/packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlSelector.tsx index c8033bc20b6..8c8c25198d6 100644 --- a/packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlSelector.tsx +++ b/packages/commonwealth/client/scripts/views/components/UrlLinkSelector/UrlSelector.tsx @@ -1,9 +1,9 @@ import React, { useCallback } from 'react'; -import 'components/UrlLinkSelector.scss'; import { Link } from 'models/Thread'; import app from 'state'; import { QueryList } from 'views/components/component_kit/cw_query_list'; +import './UrlLinkSelector.scss'; import { UrlSelectorItem } from './UrlSelectorItem'; type UrlSelectorProps = { diff --git a/packages/commonwealth/client/scripts/views/components/UserTrainingSlider/UserTrainingSlider.scss b/packages/commonwealth/client/scripts/views/components/UserTrainingSlider/UserTrainingSlider.scss index 8597fbedc61..d11c7f368f4 100644 --- a/packages/commonwealth/client/scripts/views/components/UserTrainingSlider/UserTrainingSlider.scss +++ b/packages/commonwealth/client/scripts/views/components/UserTrainingSlider/UserTrainingSlider.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .UserTrainingSliderPageLayout { padding-top: 52px; diff --git a/packages/commonwealth/client/styles/components/cards_collection.scss b/packages/commonwealth/client/scripts/views/components/cards_collection.scss similarity index 71% rename from packages/commonwealth/client/styles/components/cards_collection.scss rename to packages/commonwealth/client/scripts/views/components/cards_collection.scss index 56e61d91a85..b3e7363b490 100644 --- a/packages/commonwealth/client/styles/components/cards_collection.scss +++ b/packages/commonwealth/client/scripts/views/components/cards_collection.scss @@ -1,5 +1,5 @@ -@import '../shared'; -@import 'component_kit/cw_card'; +@import '../../styles/shared.scss'; +@import '../components/component_kit/cw_card.scss'; .CardsCollection { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/cards_collection.tsx b/packages/commonwealth/client/scripts/views/components/cards_collection.tsx index 8e727ac8084..d0f45812b5f 100644 --- a/packages/commonwealth/client/scripts/views/components/cards_collection.tsx +++ b/packages/commonwealth/client/scripts/views/components/cards_collection.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/cards_collection.scss'; +import './cards_collection.scss'; import { CWText } from './component_kit/cw_text'; diff --git a/packages/commonwealth/client/styles/components/community_label.scss b/packages/commonwealth/client/scripts/views/components/community_label.scss similarity index 70% rename from packages/commonwealth/client/styles/components/community_label.scss rename to packages/commonwealth/client/scripts/views/components/community_label.scss index 3a25b48d476..8c9bc10e929 100644 --- a/packages/commonwealth/client/styles/components/community_label.scss +++ b/packages/commonwealth/client/scripts/views/components/community_label.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .CommunityLabel { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/community_label.tsx b/packages/commonwealth/client/scripts/views/components/community_label.tsx index a35ff095878..3f9846f5153 100644 --- a/packages/commonwealth/client/scripts/views/components/community_label.tsx +++ b/packages/commonwealth/client/scripts/views/components/community_label.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/community_label.scss'; +import './community_label.scss'; import { CWCommunityAvatar } from './component_kit/cw_community_avatar'; import type { IconSize } from './component_kit/cw_icons/types'; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/AccountSelector/AccountSelector.scss b/packages/commonwealth/client/scripts/views/components/component_kit/AccountSelector/AccountSelector.scss index 27b694e219e..19c92b33b8b 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/AccountSelector/AccountSelector.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/AccountSelector/AccountSelector.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .AccountSelector { margin-bottom: 24px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPage/CWContentPage.scss b/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPage/CWContentPage.scss index 0f6625bd5bc..ec297cd1534 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPage/CWContentPage.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPage/CWContentPage.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; @mixin mainBodyStyles { .main-body-container { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPageCard/CWContentPageCard.scss b/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPageCard/CWContentPageCard.scss index cda6511e804..56530352e14 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPageCard/CWContentPageCard.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWContentPageCard/CWContentPageCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .ContentPageCard.Card { border-color: $neutral-200; @@ -13,4 +13,4 @@ padding: 8px 16px; width: 100%; } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWImageInput/CWImageInput.scss b/packages/commonwealth/client/scripts/views/components/component_kit/CWImageInput/CWImageInput.scss index a99b7be9089..008b70df41f 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWImageInput/CWImageInput.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWImageInput/CWImageInput.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .CWImageInput { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWPopoverMenu/CWPopoverMenu.scss b/packages/commonwealth/client/scripts/views/components/component_kit/CWPopoverMenu/CWPopoverMenu.scss index 13b824549d9..809415634f3 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWPopoverMenu/CWPopoverMenu.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWPopoverMenu/CWPopoverMenu.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .PopoverMenuItem { align-items: center; diff --git a/packages/commonwealth/client/styles/components/component_kit/CWSidebarHeader/CWSidebarHeader.scss b/packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.scss similarity index 94% rename from packages/commonwealth/client/styles/components/component_kit/CWSidebarHeader/CWSidebarHeader.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.scss index 9cd86338ced..f116e060bbe 100644 --- a/packages/commonwealth/client/styles/components/component_kit/CWSidebarHeader/CWSidebarHeader.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .SidebarHeader { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.tsx index ec8c4b7c874..4af0c7d8813 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CWSidebarHeader/CWSidebarHeader.tsx @@ -1,5 +1,5 @@ -import 'components/component_kit/CWSidebarHeader/CWSidebarHeader.scss'; import React from 'react'; +import './CWSidebarHeader.scss'; import { navigateToCommunity, useCommonNavigate } from 'navigation/helpers'; import app from 'state'; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/CommunityInfo/CommunityInfo.scss b/packages/commonwealth/client/scripts/views/components/component_kit/CommunityInfo/CommunityInfo.scss index 5689fce5c99..75515c88e12 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/CommunityInfo/CommunityInfo.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/CommunityInfo/CommunityInfo.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .CommunityInfo { padding: 0; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/RenderTextWithLink/RenderTextWithLink.scss b/packages/commonwealth/client/scripts/views/components/component_kit/RenderTextWithLink/RenderTextWithLink.scss index 9a4141feeae..c9d97f3235f 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/RenderTextWithLink/RenderTextWithLink.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/RenderTextWithLink/RenderTextWithLink.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .RenderTextWithLink { .mainText { display: flex; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_avatar.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.scss similarity index 76% rename from packages/commonwealth/client/styles/components/component_kit/cw_avatar.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.scss index 2d98cff9aa1..cd6245c7c0f 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_avatar.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Avatar { background-size: cover; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.tsx index 792cb607189..a49b3466f0d 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar.tsx @@ -1,7 +1,7 @@ -import 'components/component_kit/cw_avatar.scss'; import React from 'react'; import Jdenticon from 'react-jdenticon'; import { Skeleton } from '../Skeleton'; +import './cw_avatar.scss'; import { ComponentType } from './types'; type BaseAvatarProps = { diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_avatar_group.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.scss similarity index 93% rename from packages/commonwealth/client/styles/components/component_kit/cw_avatar_group.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.scss index b0de7b7d78a..b554dcae53a 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_avatar_group.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .AvatarGroup { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.tsx index 62c7e75d8fc..276bed34e89 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_avatar_group.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type MinimumProfile from '../../../models/MinimumProfile'; import clsx from 'clsx'; -import 'components/component_kit/cw_avatar_group.scss'; import { CWAvatar, CWJdenticon } from './cw_avatar'; +import './cw_avatar_group.scss'; import { CWText } from './cw_text'; export type ProfileWithAddress = MinimumProfile & { diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_banner.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.scss similarity index 94% rename from packages/commonwealth/client/styles/components/component_kit/cw_banner.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.scss index 895e0bad12e..5b40e101954 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_banner.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin bannerStyles { align-items: flex-start; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.tsx index 9aa5b3b368e..9c18551762e 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_banner.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_banner.scss'; +import './cw_banner.scss'; import { CWIconButton } from './cw_icon_button'; import RenderTextWithLink from './RenderTextWithLink'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_breadcrumbs.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.scss similarity index 92% rename from packages/commonwealth/client/styles/components/component_kit/cw_breadcrumbs.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.scss index 81f501fa201..2964a819d20 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_breadcrumbs.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Breadcrumbs { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.tsx index dcda32e35cc..1b2c08849ff 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_breadcrumbs.tsx @@ -2,8 +2,8 @@ import clsx from 'clsx'; import React from 'react'; import { CWTooltip } from '../component_kit/new_designs/CWTooltip'; -import 'components/component_kit/cw_breadcrumbs.scss'; import { truncateText } from '../Breadcrumbs/utils'; +import './cw_breadcrumbs.scss'; import { CWText } from './cw_text'; import { ComponentType } from './types'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_card.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_card.scss similarity index 96% rename from packages/commonwealth/client/styles/components/component_kit/cw_card.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_card.scss index ae084c6e98b..fabc49c57eb 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_card.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_card.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; $default-card-width: 260px; $default-card-height: 100px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_card.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_card.tsx index a9235d89b34..7781b95489b 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_card.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_card.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_card.scss'; +import './cw_card.scss'; import { getClasses } from './helpers'; import { ComponentType } from './types'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_checkbox.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.scss similarity index 97% rename from packages/commonwealth/client/styles/components/component_kit/cw_checkbox.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.scss index 270b2c8c288..d05962a24cd 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_checkbox.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Checkbox { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.tsx index aa9f66dcdc9..0fd5417ebf0 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_checkbox.tsx @@ -1,6 +1,6 @@ import React, { ChangeEvent } from 'react'; -import 'components/component_kit/cw_checkbox.scss'; +import './cw_checkbox.scss'; import { CWText } from './cw_text'; import { getClasses } from './helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_collapsible.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.scss similarity index 93% rename from packages/commonwealth/client/styles/components/component_kit/cw_collapsible.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.scss index 15193eb14ed..415c347cffe 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_collapsible.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Collapsible { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.tsx index 6c570a83167..26aff0715b6 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_collapsible.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_collapsible.scss'; +import './cw_collapsible.scss'; import { CWIconButton } from './cw_icon_button'; import { ComponentType } from './types'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_community_avatar.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.scss similarity index 96% rename from packages/commonwealth/client/styles/components/component_kit/cw_community_avatar.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.scss index 5e100d73116..80223704b33 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_community_avatar.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .CommunityAvatar { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx index 84093781e63..cbbac6f19b6 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_community_avatar.tsx @@ -1,6 +1,6 @@ -import 'components/component_kit/cw_community_avatar.scss'; import React from 'react'; import { Skeleton } from '../Skeleton'; +import './cw_community_avatar.scss'; import type { IconSize } from './cw_icons/types'; import { CWText } from './cw_text'; import { getClasses } from './helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_divider.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.scss similarity index 77% rename from packages/commonwealth/client/styles/components/component_kit/cw_divider.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.scss index d3eb68d3ab6..52a78bd5f1d 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_divider.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Divider { background-color: $neutral-100; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.tsx index 75f196a3085..ace5cc89f3a 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_divider.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_divider.scss'; +import './cw_divider.scss'; import { getClasses } from './helpers'; import { ComponentType } from './types'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_dropdown.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.scss similarity index 95% rename from packages/commonwealth/client/styles/components/component_kit/cw_dropdown.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.scss index 12c7f652850..bd573f924bd 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_dropdown.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .dropdown-wrapper { position: relative; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.tsx index a0e8cfd58af..8341e8c1d4f 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_dropdown.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import 'components/component_kit/cw_dropdown.scss'; +import './cw_dropdown.scss'; import { CWText } from './cw_text'; import { CWTextInput } from './cw_text_input'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_empty_state.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.scss similarity index 87% rename from packages/commonwealth/client/styles/components/component_kit/cw_empty_state.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.scss index f70d8cc8472..3c9ab5d684c 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_empty_state.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .EmptyState { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.tsx index cbd944632fa..38c5f2b6966 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_empty_state.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_empty_state.scss'; +import './cw_empty_state.scss'; import { AutomationTestProps } from '../../pages/error'; import { CWIcon } from './cw_icons/cw_icon'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_growl.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.scss similarity index 94% rename from packages/commonwealth/client/styles/components/component_kit/cw_growl.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.scss index abecbd7c889..e6d33bd418d 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_growl.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../styles/shared.scss'; $growl-outside-bottom-padding: 16px; $growl-outside-left-padding: 16px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.tsx index b11b98b786c..bc643ba5337 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_growl.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_growl.scss'; +import './cw_growl.scss'; import { CWCard } from './cw_card'; import { getClasses } from './helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_icon_button.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icon_button.scss similarity index 96% rename from packages/commonwealth/client/styles/components/component_kit/cw_icon_button.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_icon_button.scss index aef2927ed21..104a73956b0 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_icon_button.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icon_button.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .IconButton { @include baseIconStyles; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_custom_icon.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_custom_icon.tsx index e365cc06ce0..8514efd289e 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_custom_icon.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_custom_icon.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import 'components/component_kit/cw_icon.scss'; import { ComponentType } from '../types'; +import './cw_icon.scss'; import { customIconLookup } from './cw_icon_lookup'; import type { CustomIconProps } from './types'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_icon.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.scss similarity index 84% rename from packages/commonwealth/client/styles/components/component_kit/cw_icon.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.scss index 7cfb8b97302..a1c203bf34a 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_icon.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../../styles/shared.scss'; .Icon { @include baseIconStyles; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.tsx index 9357a1bcd0c..7549d8c805f 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import 'components/component_kit/cw_icon.scss'; import { ComponentType } from '../types'; +import './cw_icon.scss'; import { iconLookup } from './cw_icon_lookup'; import type { IconComponentProps } from './types'; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx index f840924a021..b72386dc357 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx @@ -1,8 +1,8 @@ /* eslint-disable max-len */ import React from 'react'; -import 'components/component_kit/cw_icon.scss'; -import 'components/component_kit/cw_icon_button.scss'; +import '../cw_icon_button.scss'; +import './cw_icon.scss'; import { getClasses } from '../helpers'; import type { IconProps, IconStyleProps } from './types'; @@ -107,6 +107,7 @@ export const CWArchiveTray = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArchiveTrayFilled = (props: IconProps) => { const { className, @@ -138,6 +139,7 @@ export const CWArchiveTrayFilled = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowDownBlue500 = (props: IconProps) => { const { className, @@ -177,6 +179,7 @@ export const CWArrowDownBlue500 = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowFatUp = (props: IconProps) => { const { className, @@ -211,6 +214,7 @@ export const CWArrowFatUp = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowFatUpNeutral = (props: IconProps) => { const { className, @@ -244,6 +248,7 @@ export const CWArrowFatUpNeutral = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowFatUpBlue500 = (props: IconProps) => { const { className, @@ -277,6 +282,7 @@ export const CWArrowFatUpBlue500 = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowFatUpBlue600 = (props: IconProps) => { const { className, @@ -310,6 +316,7 @@ export const CWArrowFatUpBlue600 = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowLeft = (props: IconProps) => { const { className, @@ -343,6 +350,7 @@ export const CWArrowLeft = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowRight = (props: IconProps) => { const { className, @@ -375,6 +383,7 @@ export const CWArrowRight = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowUpBlue500 = (props: IconProps) => { const { className, @@ -414,6 +423,7 @@ export const CWArrowUpBlue500 = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWArrowUpNeutral400 = (props: IconProps) => { const { className, @@ -455,6 +465,7 @@ export const CWArrowUpNeutral400 = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWBacker = (props: IconProps) => { const { className, @@ -492,6 +503,7 @@ export const CWBacker = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWBadge = (props: IconProps) => { const { className, @@ -521,6 +533,7 @@ export const CWBadge = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWBellNew = (props: IconProps) => { const { className, @@ -562,6 +575,7 @@ export const CWBellNew = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCautionCircle = (props: IconProps) => { const { className, @@ -596,6 +610,7 @@ export const CWCautionCircle = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCautionTriangle = (props: IconProps) => { const { className, @@ -630,6 +645,7 @@ export const CWCautionTriangle = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCheck = (props: IconProps) => { const { className, @@ -662,6 +678,7 @@ export const CWCheck = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWChevronDown = (props: IconProps) => { const { className, @@ -694,6 +711,7 @@ export const CWChevronDown = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWChevronLeft = (props: IconProps) => { const { className, @@ -726,6 +744,7 @@ export const CWChevronLeft = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWChevronRight = (props: IconProps) => { const { className, @@ -758,6 +777,7 @@ export const CWChevronRight = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWChevronUp = (props: IconProps) => { const { className, @@ -790,6 +810,7 @@ export const CWChevronUp = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWClock = (props: IconProps) => { const { className, @@ -822,6 +843,7 @@ export const CWClock = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWClose = (props: IconProps) => { const { className, @@ -858,6 +880,7 @@ export const CWClose = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCloud = (props: IconProps) => { const { className, @@ -894,6 +917,7 @@ export const CWCloud = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCollapse = (props: IconProps) => { const { className, @@ -926,6 +950,7 @@ export const CWCollapse = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCommonLogo = (props: IconProps) => { const { className, @@ -982,6 +1007,7 @@ export const CWCommonLogo = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCompass = (props: IconProps) => { const { className, @@ -1015,6 +1041,7 @@ export const CWCompass = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCopy = (props: IconProps) => { const { className, @@ -1048,6 +1075,7 @@ export const CWCopy = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCosmos = (props: IconProps) => { const { className, @@ -1108,6 +1136,7 @@ export const CWCosmos = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCow = (props: IconProps) => { const { className, @@ -1140,6 +1169,7 @@ export const CWCow = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWCurator = (props: IconProps) => { const { className, @@ -1174,6 +1204,7 @@ export const CWCurator = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDelegate = (props: IconProps) => { const { className, @@ -1209,6 +1240,7 @@ export const CWDelegate = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDemocraticProposal = (props: IconProps) => { const { className, @@ -1241,6 +1273,7 @@ export const CWDemocraticProposal = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDiscord = (props: IconProps) => { const { className, @@ -1269,6 +1302,7 @@ export const CWDiscord = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDiscordLogin = (props: IconProps) => { const { className, @@ -1300,6 +1334,7 @@ export const CWDiscordLogin = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDot = (props: IconProps) => { const { className, @@ -1332,6 +1367,7 @@ export const CWDot = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDots = (props: IconProps) => { const { className, @@ -1360,6 +1396,7 @@ export const CWDots = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDotsHorizontal = (props: IconProps) => { const { className, @@ -1403,6 +1440,7 @@ export const CWDotsHorizontal = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWDotsVertical = (props: IconProps) => { const { className, @@ -1431,6 +1469,7 @@ export const CWDotsVertical = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWEdgeware = (props: IconProps) => { const { className, @@ -1494,6 +1533,7 @@ export const CWEdgeware = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWElement = (props: IconProps) => { const { className, @@ -1526,6 +1566,7 @@ export const CWElement = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWEnvelope = (props: IconProps) => { const { className, @@ -1565,6 +1606,7 @@ export const CWEnvelope = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWEthereum = (props: IconProps) => { const { className, @@ -1616,6 +1658,7 @@ export const CWEthereum = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWEtherscan = (props: IconProps) => { const { className, @@ -1651,6 +1694,7 @@ export const CWEtherscan = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWExpand = (props: IconProps) => { const { className, @@ -1683,6 +1727,7 @@ export const CWExpand = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWExploreCommunities = (props: IconProps) => { const { className, @@ -1716,6 +1761,7 @@ export const CWExploreCommunities = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWExternalLink = (props: IconProps) => { const { className, @@ -1771,6 +1817,7 @@ export const CWExternalLink = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWFeedback = (props: IconProps) => { const { className, @@ -1803,6 +1850,7 @@ export const CWFeedback = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWFilter = (props: IconProps) => { const { className, @@ -1835,6 +1883,7 @@ export const CWFilter = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWFlame = (props: IconProps) => { const { className, @@ -1863,6 +1912,7 @@ export const CWFlame = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWGear = (props: IconProps) => { const { className, @@ -1945,6 +1995,7 @@ export const CWGear = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWGithub = (props: IconProps) => { const { className, @@ -1977,6 +2028,7 @@ export const CWGithub = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWHamburger = (props: IconProps) => { const { className, @@ -2004,6 +2056,7 @@ export const CWHamburger = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWHash = (props: IconProps) => { const { className, @@ -2036,6 +2089,7 @@ export const CWHash = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWHeartEmpty = (props: IconProps) => { const { className, @@ -2068,6 +2122,7 @@ export const CWHeartEmpty = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWHeartFilled = (props: IconProps) => { const { className, @@ -2100,6 +2155,7 @@ export const CWHeartFilled = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWHelp = (props: IconProps) => { const { className, @@ -2132,6 +2188,7 @@ export const CWHelp = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWHome = (props: IconProps) => { const { className, @@ -2164,6 +2221,7 @@ export const CWHome = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWInfoEmpty = (props: IconProps) => { const { className, @@ -2195,6 +2253,7 @@ export const CWInfoEmpty = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWImageUpload = (props: IconProps) => { const { className, @@ -2223,6 +2282,7 @@ export const CWImageUpload = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWInfoFilled = (props: IconProps) => { const { className, @@ -2255,6 +2315,7 @@ export const CWInfoFilled = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWJar = (props: IconProps) => { const { className, @@ -2288,6 +2349,7 @@ export const CWJar = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWLink = (props: IconProps) => { const { className, @@ -2320,6 +2382,7 @@ export const CWLink = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWLock = (props: IconProps) => { const { className, @@ -2352,6 +2415,7 @@ export const CWLock = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWLogout = (props: IconProps) => { const { className, @@ -2389,6 +2453,7 @@ export const CWLogout = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWMail = (props: IconProps) => { const { className, @@ -2421,6 +2486,7 @@ export const CWMail = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWMute = (props: IconProps) => { const { className, @@ -2454,6 +2520,7 @@ export const CWMute = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWNear = (props: IconProps) => { const { className, @@ -2485,6 +2552,7 @@ export const CWNear = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWNewStar = (props: IconProps) => { const { className, @@ -2513,6 +2581,7 @@ export const CWNewStar = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWOctocat = (props: IconProps) => { const { className, @@ -2544,6 +2613,7 @@ export const CWOctocat = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWPeople = (props: IconProps) => { const { className, @@ -2577,6 +2647,7 @@ export const CWPeople = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWPerson = (props: IconProps) => { const { className, @@ -2609,6 +2680,7 @@ export const CWPerson = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWPlus = (props: IconProps) => { const { className, @@ -2638,6 +2710,7 @@ export const CWPlus = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWPlusCircle = (props: IconProps) => { const { className, @@ -2670,6 +2743,7 @@ export const CWPlusCircle = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWPolkadot = (props: IconProps) => { const { className, @@ -2721,6 +2795,7 @@ export const CWPolkadot = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWPolygon = (props: IconProps) => { const { className, @@ -2752,6 +2827,7 @@ export const CWPolygon = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWSearch = (props: IconProps) => { const { className, @@ -2784,6 +2860,7 @@ export const CWSearch = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWSend = (props: IconProps) => { const { className, @@ -2816,6 +2893,7 @@ export const CWSend = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWShare2 = (props: IconProps) => { const { className, @@ -2848,6 +2926,7 @@ export const CWShare2 = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWSidebarCollapse = (props: IconProps) => { const { className, @@ -2880,6 +2959,7 @@ export const CWSidebarCollapse = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWSidebarExpand = (props: IconProps) => { const { className, @@ -2912,6 +2992,7 @@ export const CWSidebarExpand = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWStar = (props: IconProps) => { const { className, @@ -2940,6 +3021,7 @@ export const CWStar = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWSun = (props: IconProps) => { const { className, @@ -3018,6 +3100,7 @@ export const CWSun = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTelegram = (props: IconProps) => { const { className, @@ -3050,6 +3133,7 @@ export const CWTelegram = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTransfer = (props: IconProps) => { const { className, @@ -3082,6 +3166,7 @@ export const CWTransfer = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTreasuryProposal = (props: IconProps) => { const { className, @@ -3114,6 +3199,7 @@ export const CWTreasuryProposal = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTrendUp = (props: IconProps) => { const { className, @@ -3154,6 +3240,7 @@ export const CWTrendUp = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTwitter = (props: IconProps) => { const { className, @@ -3185,6 +3272,7 @@ export const CWTwitter = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTwitterNew = (props: IconProps) => { const { className, @@ -3216,6 +3304,7 @@ export const CWTwitterNew = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWTwitterX = (props: IconProps) => { const { className, @@ -3247,6 +3336,7 @@ export const CWTwitterX = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWUnsubscribe = (props: IconProps) => { const { className, @@ -3279,6 +3369,7 @@ export const CWUnsubscribe = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWViews = (props: IconProps) => { const { className, @@ -3312,6 +3403,7 @@ export const CWViews = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWVote = (props: IconProps) => { const { className, @@ -3350,6 +3442,7 @@ export const CWVote = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWWallet = (props: IconProps) => { const { className, @@ -3388,6 +3481,7 @@ export const CWWallet = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWWebsite = (props: IconProps) => { const { className, @@ -3420,6 +3514,7 @@ export const CWWebsite = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWWrite = (props: IconProps) => { const { className, @@ -3452,6 +3547,7 @@ export const CWWrite = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWGoogle = (props: IconProps) => { const { className, @@ -3496,6 +3592,7 @@ export const CWGoogle = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const CWMembers = ({ componentType, iconSize, diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_phosphor_icons.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_phosphor_icons.tsx index e398ff80d41..90ec2777065 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_phosphor_icons.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_phosphor_icons.tsx @@ -1,33 +1,37 @@ /* eslint-disable max-len */ import { Icon as PhosphorIcon } from '@phosphor-icons/react'; -import 'components/component_kit/cw_icon.scss'; -import 'components/component_kit/cw_icon_button.scss'; import React from 'react'; +import '../cw_icon_button.scss'; import { getClasses } from '../helpers'; +import './cw_icon.scss'; import type { IconProps, IconStyleProps } from './types'; -export const withPhosphorIcon = (Icon: PhosphorIcon) => (props: IconProps) => { - const { - className, - componentType, - disabled, - iconButtonTheme, - iconSize, - selected, - weight, - ...otherProps - } = props; +export const withPhosphorIcon = (Icon: PhosphorIcon) => { + function wrapper(props: IconProps) { + const { + className, + componentType, + disabled, + iconButtonTheme, + iconSize, + selected, + weight, + ...otherProps + } = props; - return ( - ( - { className, disabled, iconButtonTheme, iconSize, selected }, - componentType - )} - onClick={otherProps.onClick} - onMouseEnter={otherProps.onMouseEnter} - onMouseLeave={otherProps.onMouseLeave} - weight={weight} - /> - ); + return ( + ( + { className, disabled, iconButtonTheme, iconSize, selected }, + componentType, + )} + onClick={otherProps.onClick} + onMouseEnter={otherProps.onMouseEnter} + onMouseLeave={otherProps.onMouseLeave} + weight={weight} + /> + ); + } + + return wrapper; }; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_label.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_label.scss similarity index 61% rename from packages/commonwealth/client/styles/components/component_kit/cw_label.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_label.scss index dda6b1d265c..17430c4a5ac 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_label.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_label.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Label.Text { color: $neutral-500; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_label.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_label.tsx index 89c3e08193b..f6b843146f1 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_label.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_label.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_label.scss'; +import './cw_label.scss'; import { CWText } from './cw_text'; import { ComponentType } from './types'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_progress_bar.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.scss similarity index 97% rename from packages/commonwealth/client/styles/components/component_kit/cw_progress_bar.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.scss index c3a7b3865e6..fdd64524434 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_progress_bar.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProgressBar { border-radius: $border-radius-corners; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.tsx index 97cb06fb85e..19044738300 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_progress_bar.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import 'components/component_kit/cw_progress_bar.scss'; import { CWIcon } from './cw_icons/cw_icon'; import type { IconName } from './cw_icons/cw_icon_lookup'; +import './cw_progress_bar.scss'; import { CWText } from './cw_text'; import { getClasses } from './helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_query_list.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.scss similarity index 81% rename from packages/commonwealth/client/styles/components/component_kit/cw_query_list.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.scss index b0e8d62e4ec..09bca2b9435 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_query_list.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .QueryList { .LoadingSpinner { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.tsx index 49afa51923b..323df89b606 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_query_list.tsx @@ -1,7 +1,7 @@ -import 'components/component_kit/cw_query_list.scss'; import React from 'react'; import type { Components, ItemContent } from 'react-virtuoso'; import { Virtuoso } from 'react-virtuoso'; +import './cw_query_list.scss'; import CWCircleMultiplySpinner from './new_designs/CWCircleMultiplySpinner'; interface QueryListProps { diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_radio_button.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.scss similarity index 96% rename from packages/commonwealth/client/styles/components/component_kit/cw_radio_button.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.scss index dd71402880a..bd79a4abad2 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_radio_button.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin radioCore($color) { display: grid; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.tsx index e85234ca93b..ab36ec935c6 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_button.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_radio_button.scss'; +import './cw_radio_button.scss'; import { CWText } from './cw_text'; import { getClasses } from './helpers'; @@ -49,7 +49,7 @@ export const CWRadioButton = (props: RadioButtonProps) => { checked, disabled, }, - ComponentType.RadioButton + ComponentType.RadioButton, )} > diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_radio_group.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_group.scss similarity index 100% rename from packages/commonwealth/client/styles/components/component_kit/cw_radio_group.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_group.scss diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_group.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_group.tsx index dccff28f2fb..f07fe634fd0 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_group.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_radio_group.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_radio_group.scss'; +import './cw_radio_group.scss'; import type { RadioButtonType } from './cw_radio_button'; import { CWRadioButton } from './cw_radio_button'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_select_list.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.scss similarity index 51% rename from packages/commonwealth/client/styles/components/component_kit/cw_select_list.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.scss index 68bd8907b1d..a0cc0f8cbb2 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_select_list.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .SelectList { @include inputStyles; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.tsx index 4781a7ab3a2..942633a60fd 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_select_list.tsx @@ -2,16 +2,18 @@ import React from 'react'; import type { GroupBase, OptionProps, Props } from 'react-select'; import Select, { components } from 'react-select'; -import 'components/component_kit/cw_select_list.scss'; import { CWTooltip } from 'views/components/component_kit/new_designs/CWTooltip'; +import './cw_select_list.scss'; const CustomOption = ( props: OptionProps & { disabledOptionTooltipText?: string }, ) => { + // eslint-disable-next-line react/destructuring-assignment if ((props.data as any)?.disabled) { return ( ( @@ -27,6 +29,7 @@ const CustomOption = ( }, }} > + {/* eslint-disable-next-line react/destructuring-assignment */} {props.children} )} @@ -34,12 +37,14 @@ const CustomOption = ( ); } + // eslint-disable-next-line react/destructuring-assignment return {props.children}; }; interface SelectListProps { disabledOptionTooltipText?: string; } +// eslint-disable-next-line react/no-multi-comp export const SelectList = < Option, IsMulti extends boolean = false, @@ -52,10 +57,12 @@ export const SelectList = < {...props} isOptionDisabled={(option) => (option as any)?.disabled} components={{ + // eslint-disable-next-line react/no-multi-comp Option: (optionProps) => ( // @ts-expect-error @@ -74,6 +81,7 @@ export const SelectList = < maxHeight: '300px', }), }} + // eslint-disable-next-line react/destructuring-assignment className={`SelectList ${props.className || ''}`} /> ); diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_sidebar_menu.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.scss similarity index 96% rename from packages/commonwealth/client/styles/components/component_kit/cw_sidebar_menu.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.scss index 7cd0a69e386..27d2f34dcb8 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_sidebar_menu.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .SidebarMenuItem { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.tsx index 1c264ba2487..60c440222f0 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_sidebar_menu.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { isMobile } from 'react-device-detect'; -import 'components/component_kit/cw_sidebar_menu.scss'; +import './cw_sidebar_menu.scss'; import useBrowserWindow from 'client/scripts/hooks/useBrowserWindow'; import { navigateToCommunity, useCommonNavigate } from 'navigation/helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_text.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text.scss similarity index 98% rename from packages/commonwealth/client/styles/components/component_kit/cw_text.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_text.scss index a395c7e29aa..4de9006b9fa 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_text.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Text { color: $neutral-800; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_text.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text.tsx index 3eb25068510..8ade3b8a0f8 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_text.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { getClasses } from './helpers'; import { ComponentType } from './types'; -import 'components/component_kit/cw_text.scss'; +import './cw_text.scss'; type FontWeight = | 'regular' diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_text_area.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.scss similarity index 88% rename from packages/commonwealth/client/styles/components/component_kit/cw_text_area.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.scss index 28f39d6ac76..9adc570894e 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_text_area.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .TextArea { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.tsx index a5681e9929c..e6c67cee3e7 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_area.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; -import 'components/component_kit/cw_text_area.scss'; +import './cw_text_area.scss'; import { useFormContext } from 'react-hook-form'; import { CWLabel } from './cw_label'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_text_input.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.scss similarity index 97% rename from packages/commonwealth/client/styles/components/component_kit/cw_text_input.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.scss index e62150732f5..1bb906ece38 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_text_input.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin iconPositionStyles { position: absolute; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.tsx index daa2af83901..b8a74638591 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_text_input.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import 'components/component_kit/cw_text_input.scss'; import { CWIconButton } from './cw_icon_button'; import { CWIcon } from './cw_icons/cw_icon'; import type { IconName } from './cw_icons/cw_icon_lookup'; import { CWLabel } from './cw_label'; import { CWText } from './cw_text'; +import './cw_text_input.scss'; import type { ValidationStatus } from './cw_validation_text'; import { getClasses } from './helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_toggle.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.scss similarity index 95% rename from packages/commonwealth/client/styles/components/component_kit/cw_toggle.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.scss index c49892d09ff..3820f4449b4 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_toggle.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Toggle { background-color: $neutral-300; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.tsx index 547cbeacf05..f392adc59d7 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_toggle.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_toggle.scss'; +import './cw_toggle.scss'; import { setDarkMode } from '../../../helpers/darkMode'; import { getClasses } from './helpers'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_truncated_address.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss similarity index 90% rename from packages/commonwealth/client/styles/components/component_kit/cw_truncated_address.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss index 79ea585ba10..c530021eb7c 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_truncated_address.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .TruncatedAddress { width: 120px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx index af9790efe52..61273826628 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/component_kit/cw_truncated_address.scss'; +import './cw_truncated_address.scss'; import { formatAddressShort } from '../../../helpers'; import { CWCommunityAvatar } from './cw_community_avatar'; diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_validation_text.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.scss similarity index 77% rename from packages/commonwealth/client/styles/components/component_kit/cw_validation_text.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.scss index 016395e6ddd..1de43e06228 100644 --- a/packages/commonwealth/client/styles/components/component_kit/cw_validation_text.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ValidationText.Text { margin-top: 4px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.tsx index 0bdc20fb3c4..d8fda61e2df 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_validation_text.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { CWText } from './cw_text'; -import { ComponentType } from './types'; import { getClasses } from './helpers'; +import { ComponentType } from './types'; -import 'components/component_kit/cw_validation_text.scss'; +import './cw_validation_text.scss'; export type ValidationStatus = 'success' | 'failure'; @@ -23,7 +23,7 @@ export const CWValidationText = (props: ValidationTextProps) => { fontWeight="medium" className={getClasses( { status, className }, - ComponentType.ValidationText + ComponentType.ValidationText, )} > {message} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/helpers.ts b/packages/commonwealth/client/scripts/views/components/component_kit/helpers.ts index 4db717b4520..463b6fcec7c 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/helpers.ts +++ b/packages/commonwealth/client/scripts/views/components/component_kit/helpers.ts @@ -1,6 +1,6 @@ import { isBoolean, isNotNil } from 'helpers/typeGuards'; -import breakpoints from '../../../../styles/mixins/breakpoints.module.scss'; +import breakpoints from '../../../styles/mixins/breakpoints.module.scss'; export const getClasses = ( styleAttrs: T, diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWBanner.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.scss similarity index 97% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/CWBanner.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.scss index 911a5d96c50..2320c843f76 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWBanner.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; @mixin bannerTheme($main, $background, $accent) { border: 1px solid $main; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.tsx index 2ba2b83cef0..392024c7ab8 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWBanner.tsx @@ -9,13 +9,13 @@ import { import React, { ReactNode } from 'react'; import clsx from 'clsx'; -import 'components/component_kit/new_designs/CWBanner.scss'; import { CWText } from 'views/components/component_kit/cw_text'; import { ButtonProps, ButtonType, CWButton, } from 'views/components/component_kit/new_designs/CWButton'; +import './CWBanner.scss'; const typeIconLookup: { [key in BannerType]: React.ForwardRefExoticComponent; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWButton/CWButton.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWButton/CWButton.scss index 497018aa75f..2739a7a6b53 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWButton/CWButton.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWButton/CWButton.scss @@ -1,5 +1,5 @@ -@import '../../../../../../styles/shared'; -@import '../../../../../../styles/components/component_kit/new_designs/mixins/buttons'; +@import '../../../../../styles/shared'; +@import './buttons'; .btn-border { &.primary { diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/mixins/buttons.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWButton/buttons.scss similarity index 100% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/mixins/buttons.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWButton/buttons.scss diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleButton/CWCircleButton.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleButton/CWCircleButton.scss index 4541f7a8c1d..f2955d56a76 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleButton/CWCircleButton.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleButton/CWCircleButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .circle-btn-border { cursor: pointer; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleRingSpinner/CWCircleRingSpinner.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleRingSpinner/CWCircleRingSpinner.scss index 0bf552c6207..78d01430445 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleRingSpinner/CWCircleRingSpinner.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCircleRingSpinner/CWCircleRingSpinner.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; @keyframes spin { to { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunitySelector/CWCommunitySelector.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunitySelector/CWCommunitySelector.scss index 1f7458918eb..2acadf8a1ec 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunitySelector/CWCommunitySelector.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunitySelector/CWCommunitySelector.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CommunitySelector { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawer.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawer.scss index b985b044cf4..7098c7688ee 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawer.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawer.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .Drawer { overflow: auto; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawerTopBar/CWDrawerTopBar.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawerTopBar/CWDrawerTopBar.scss index bbfb1ee9e4c..95a3e28dc18 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawerTopBar/CWDrawerTopBar.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWDrawer/CWDrawerTopBar/CWDrawerTopBar.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared.scss'; +@import '../../../../../../styles/shared.scss'; .DrawerTopBar { position: sticky; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/CWFormSteps.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/CWFormSteps.scss index 7c5f068b3ee..db6ee6d4326 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/CWFormSteps.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/CWFormSteps.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .FormSteps { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/FormStep.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/FormStep.scss index dcb8246ca02..4d93f071358 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/FormStep.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWFormSteps/FormStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .FormStep { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWGrid/CWGrid.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWGrid/CWGrid.scss index 464d6e7c46e..39c13ef217d 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWGrid/CWGrid.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWGrid/CWGrid.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .Grid { display: grid; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIconButton/CWIconButton.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIconButton/CWIconButton.scss index c88814a8133..b5f423d3220 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIconButton/CWIconButton.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIconButton/CWIconButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .CWIconButton { border-radius: $border-radius-corners-wider; diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWIdentificationTag.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.scss similarity index 91% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/CWIdentificationTag.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.scss index a2e43578c92..616235cebad 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWIdentificationTag.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .CWIdentificationTag { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.tsx index 43c9b99d3b7..f6ca31f689b 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWIdentificationTag.tsx @@ -4,7 +4,7 @@ import { CWCustomIcon } from 'views/components/component_kit/cw_icons/cw_custom_ import { CustomIconName } from 'views/components/component_kit/cw_icons/cw_icon_lookup'; import { CWText } from 'views/components/component_kit/cw_text'; -import 'components/component_kit/new_designs/CWIdentificationTag.scss'; +import './CWIdentificationTag.scss'; interface CWIdentificationTagProps { iconLeft?: CustomIconName; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModal.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModal.scss index a9b9d1caa08..8f8ac15879a 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModal.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .MuiModal-root { position: fixed; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModalHeader/CWModalHeader.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModalHeader/CWModalHeader.scss index a7a008c3929..3d0507896dc 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModalHeader/CWModalHeader.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWModal/CWModalHeader/CWModalHeader.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .CWModalHeader { width: 100%; @@ -64,4 +64,4 @@ margin-top: 8px; word-break: break-word; } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPageLayout/CWPageLayout.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPageLayout/CWPageLayout.scss index bcf7a099f43..ad4c8b0dc93 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPageLayout/CWPageLayout.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPageLayout/CWPageLayout.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .PageLayout { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPagination/CWPagination.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPagination/CWPagination.scss index 0ae4ca49216..da71af206c0 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPagination/CWPagination.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPagination/CWPagination.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .Pagination { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPopover/CWPopover.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPopover/CWPopover.scss index f10645f54b5..d3bc565baf9 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPopover/CWPopover.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWPopover/CWPopover.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .Popover { background-color: $white; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanel.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanel.scss index 52f95321006..92d6e428113 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanel.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanel.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .RadioPanel { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanelGroup.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanelGroup.scss index 94ec09a8716..32bfa44a790 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanelGroup.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRadioPanel/CWRadioPanelGroup.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .RadioPanelGroup { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRelatedCommunityCard/CWRelatedCommunityCard.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRelatedCommunityCard/CWRelatedCommunityCard.scss index c12aa7a804a..c78b5ff0c9d 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRelatedCommunityCard/CWRelatedCommunityCard.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWRelatedCommunityCard/CWRelatedCommunityCard.scss @@ -1,7 +1,7 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .RelatedCommunityCard { - padding: 24px; + padding: 16px; display: flex; border-radius: 6px; border: 1px solid $neutral-100; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.scss index ea83506c059..71d665f81d9 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @mixin everyRowStyles { cursor: pointer; @@ -44,7 +44,9 @@ &:focus-within { outline: none; border-color: $primary-500; - box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.12), 0px 0px 0px 3px $primary-100; + box-shadow: + 0 2px 2px -1px rgba(0, 0, 0, 0.12), + 0px 0px 0px 3px $primary-100; } &:focus-within:hover { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx index 645f6960a6d..3dbbe318581 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx @@ -84,11 +84,15 @@ export const CWSearchBar: FC = ({ const resetSearchBar = () => setSearchTerm(''); - const handleOnInput = (e: ChangeEvent) => + const handleOnInput = (e: ChangeEvent) => { + e.stopPropagation(); setSearchTerm(e.target.value); + }; const handleOnKeyUp = (e) => { + e.stopPropagation(); if (e.key === 'Enter') { + e.preventDefault(); handleGoToSearchPage(); if (size === 'small') { @@ -112,6 +116,7 @@ export const CWSearchBar: FC = ({ }; const handleOnKeyDown = (e: any) => { + e.stopPropagation(); if (e.key === 'Backspace' && searchTerm.length === 0) { setShowTag(false); } diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommentPreviewRow.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommentPreviewRow.scss index 501af106a35..4c34d4930e1 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommentPreviewRow.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommentPreviewRow.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @import './CWSearchBar.scss'; .SearchBarCommentPreviewRow { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommunityPreviewRow.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommunityPreviewRow.scss index 5499f3abedd..60e1a48122b 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommunityPreviewRow.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarCommunityPreviewRow.scss @@ -1,6 +1,6 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @import './CWSearchBar.scss'; .SearchBarCommunityPreviewRow { @include everyRowStyles; -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarDropdown.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarDropdown.scss index 2427d3db128..882ecabcdab 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarDropdown.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarDropdown.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @import './CWSearchBar.scss'; .SearchBarDropdown { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarMemberPreviewRow.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarMemberPreviewRow.scss index a528287a543..35e25d2526d 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarMemberPreviewRow.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarMemberPreviewRow.scss @@ -1,6 +1,6 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @import './CWSearchBar.scss'; .SearchBarMemberPreviewRow { @include everyRowStyles; -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarThreadPreviewRow.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarThreadPreviewRow.scss index aff721c0c8c..3242915609c 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarThreadPreviewRow.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/SearchBarThreadPreviewRow.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @import './CWSearchBar.scss'; .SearchBarThreadPreviewRow { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSelectList/CWSelectList.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSelectList/CWSelectList.scss index 425f32d65ce..30d549635f9 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSelectList/CWSelectList.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSelectList/CWSelectList.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .CWSelectList { &.disabled { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSingleSelectItem/CWSingleSelectItem.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSingleSelectItem/CWSingleSelectItem.scss index 1e089db6dfb..ee5027ac0a3 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSingleSelectItem/CWSingleSelectItem.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSingleSelectItem/CWSingleSelectItem.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .CWSingleSelectItem { display: flex; width: 97%; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.scss index 93eaddf1459..2d1ff88a44e 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTable/CWTable.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .Table { overflow-x: auto; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTab.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTab.scss index 4c0e3e278b0..09ba20a71c6 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTab.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTab.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .Tab { outline: none; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTabsRow.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTabsRow.scss index fec751c4306..5e6fbbccc29 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTabsRow.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTabs/CWTabsRow.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .CWTabsRow { display: inline-flex; diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWTag.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.scss similarity index 99% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/CWTag.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.scss index 84f8668c82e..c2b8f34fd67 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWTag.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .Tag { font-family: $font-family-neue-haas-unica; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.tsx index 22500a34a16..4da19310bc9 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTag.tsx @@ -7,7 +7,7 @@ import { CWText } from '../cw_text'; import { getClasses } from '../helpers'; import { ComponentType } from '../types'; -import 'components/component_kit/new_designs/CWTag.scss'; +import './CWTag.scss'; type TagType = | 'passed' diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.scss index a539b0d4015..f5d5813d986 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; @mixin iconPositionStyles { position: absolute; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.tsx index b38282f454c..e5bce714b8c 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/CWTextInput.tsx @@ -41,6 +41,7 @@ export type BaseTextInputProps = { type?: 'text' | 'number'; min?: number; step?: number; + readOnly?: boolean; }; type InputStyleProps = { @@ -110,6 +111,7 @@ const CWTextInput = (props: TextInputProps) => { type = 'text', min, step, + readOnly, } = props; const formContext = useFormContext(); @@ -171,6 +173,7 @@ const CWTextInput = (props: TextInputProps) => { ({ diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/MessageRow.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/MessageRow.scss index 3e3028fb4e1..87feb0d2656 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/MessageRow.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTextInput/MessageRow.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .MessageRow { display: flex; diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWTooltip.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.scss similarity index 93% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/CWTooltip.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.scss index cf9de88191a..95d7835432f 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/CWTooltip.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../../styles/shared.scss'; @mixin tip($top, $right, $bottom, $left) { position: absolute; @@ -94,7 +94,9 @@ font-size: 12px; line-height: 16px; letter-spacing: 0.02em; - font-feature-settings: 'tnum' on, 'lnum' on; + font-feature-settings: + 'tnum' on, + 'lnum' on; color: $white; word-break: break-word; } diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.tsx index 829f0fa6f57..9411e1fd8c3 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTooltip/CWTooltip.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react'; -import 'components/component_kit/new_designs/CWTooltip.scss'; +import './CWTooltip.scss'; import { Placement } from '@popperjs/core/lib'; import CWPopover, { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTypeaheadSelectList/CWTypeaheadSelectList.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTypeaheadSelectList/CWTypeaheadSelectList.scss index dd4ff8eb1d8..07ae28e6abf 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTypeaheadSelectList/CWTypeaheadSelectList.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWTypeaheadSelectList/CWTypeaheadSelectList.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .TypeaheadSelectList { .CWSelectList .SelectList { @@ -72,4 +72,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_radio_button.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.scss similarity index 93% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/cw_radio_button.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.scss index 2e1ba11973a..6974db83286 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_radio_button.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .container { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.tsx index a12af3a44ee..34508209894 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_radio_button.tsx @@ -2,8 +2,8 @@ import React, { ReactNode } from 'react'; import { useFormContext } from 'react-hook-form'; import clsx from 'clsx'; -import '../../../../../styles/components/component_kit/new_designs/cw_radio_button.scss'; import { CWText } from '../cw_text'; +import './cw_radio_button.scss'; export type RadioButtonType = { label?: string | ReactNode; diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_thread_action.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.scss similarity index 96% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/cw_thread_action.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.scss index 5f1c4e590f0..c3f51f4f571 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_thread_action.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.scss @@ -1,4 +1,4 @@ -@import '../../../shared.scss'; +@import '../../../../styles/shared.scss'; .ThreadAction { border-radius: 6px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.tsx index 3cc8ca606e5..78ecf52ffd3 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_thread_action.tsx @@ -13,7 +13,7 @@ import { CWText } from '../cw_text'; import { getClasses } from '../helpers'; import { ComponentType } from '../types'; -import 'components/component_kit/new_designs/cw_thread_action.scss'; +import './cw_thread_action.scss'; export type ActionType = | 'upvote' diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_toggle.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.scss similarity index 93% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/cw_toggle.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.scss index 7dc9cd74500..578601eeed5 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_toggle.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .Toggle { background-color: $neutral-200; @@ -46,7 +46,8 @@ position: absolute; top: 2px; transition: all ease-in-out 0.1s; - box-shadow: 0px 1px 3px rgba(40, 39, 41, 0.1), + box-shadow: + 0px 1px 3px rgba(40, 39, 41, 0.1), 0px 1px 2px rgba(40, 39, 41, 0.06); &.large { @@ -101,4 +102,4 @@ background-color: $neutral-100; } } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.tsx index 64b93896974..3a092bf2a0f 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_toggle.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import 'components/component_kit/new_designs/cw_toggle.scss'; +import './cw_toggle.scss'; import { useFormContext } from 'react-hook-form'; import { setDarkMode } from '../../../../helpers/darkMode'; diff --git a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_upvote.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.scss similarity index 95% rename from packages/commonwealth/client/styles/components/component_kit/new_designs/cw_upvote.scss rename to packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.scss index ac83a1676c1..c2aa812e194 100644 --- a/packages/commonwealth/client/styles/components/component_kit/new_designs/cw_upvote.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.scss @@ -1,4 +1,4 @@ -@import '../../../shared.scss'; +@import '../../../../styles/shared.scss'; .Upvote { min-width: 40px; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.tsx index 516c5d197cc..27938e58ce6 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/cw_upvote.tsx @@ -5,10 +5,10 @@ import { formatBigNumberShort } from 'adapters/currency'; import { CWText } from '../cw_text'; import { getClasses } from '../helpers'; -import 'components/component_kit/new_designs/cw_upvote.scss'; import { BigNumber } from 'ethers'; import { AnchorType } from 'views/components/component_kit/new_designs/CWPopover'; import { ComponentType } from '../types'; +import './cw_upvote.scss'; type CWUpvoteProps = { voteCount: string; diff --git a/packages/commonwealth/client/styles/components/feed.scss b/packages/commonwealth/client/scripts/views/components/feed.scss similarity index 86% rename from packages/commonwealth/client/styles/components/feed.scss rename to packages/commonwealth/client/scripts/views/components/feed.scss index 7ea45abbebd..53b63653b7b 100644 --- a/packages/commonwealth/client/styles/components/feed.scss +++ b/packages/commonwealth/client/scripts/views/components/feed.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .Feed { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/feed.tsx b/packages/commonwealth/client/scripts/views/components/feed.tsx index 6afefa4057d..e6e9845ae72 100644 --- a/packages/commonwealth/client/scripts/views/components/feed.tsx +++ b/packages/commonwealth/client/scripts/views/components/feed.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { Virtuoso } from 'react-virtuoso'; -import 'components/feed.scss'; +import './feed.scss'; import { PageNotFound } from '../pages/404'; import { UserDashboardRowSkeleton } from '../pages/user_dashboard/user_dashboard_row'; diff --git a/packages/commonwealth/client/styles/components/gov_explainer.scss b/packages/commonwealth/client/scripts/views/components/gov_explainer.scss similarity index 95% rename from packages/commonwealth/client/styles/components/gov_explainer.scss rename to packages/commonwealth/client/scripts/views/components/gov_explainer.scss index e60f5e64d96..b2bf3c40a23 100644 --- a/packages/commonwealth/client/styles/components/gov_explainer.scss +++ b/packages/commonwealth/client/scripts/views/components/gov_explainer.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .GovExplainer { background-color: $neutral-50; diff --git a/packages/commonwealth/client/scripts/views/components/gov_explainer.tsx b/packages/commonwealth/client/scripts/views/components/gov_explainer.tsx index 1ad9d56ecec..2523bdddea5 100644 --- a/packages/commonwealth/client/scripts/views/components/gov_explainer.tsx +++ b/packages/commonwealth/client/scripts/views/components/gov_explainer.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import 'components/gov_explainer.scss'; import { CWText } from './component_kit/cw_text'; +import './gov_explainer.scss'; type StatHeader = { statName: string; @@ -27,8 +27,8 @@ export const GovExplainer = (props: GovExplainerProps) => {
💭
- {statHeaders.map((s) => ( - + {statHeaders.map((s, i) => ( +
{s.statName} {s.statDescription}
@@ -36,8 +36,8 @@ export const GovExplainer = (props: GovExplainerProps) => { ))}
- {stats.map((s) => ( -
+ {stats.map((s, i) => ( +
{s.statHeading} diff --git a/packages/commonwealth/client/styles/components/linked_addresses.scss b/packages/commonwealth/client/scripts/views/components/linked_addresses.scss similarity index 83% rename from packages/commonwealth/client/styles/components/linked_addresses.scss rename to packages/commonwealth/client/scripts/views/components/linked_addresses.scss index b4b31c6b60f..bd130b90cd9 100644 --- a/packages/commonwealth/client/styles/components/linked_addresses.scss +++ b/packages/commonwealth/client/scripts/views/components/linked_addresses.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .LinkedAddresses { display: grid; diff --git a/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx b/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx index 184a6603cb3..b4313332583 100644 --- a/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx +++ b/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import 'components/linked_addresses.scss'; +import './linked_addresses.scss'; import { useGetCommunityByIdQuery } from 'state/api/communities'; import { PopoverMenu } from 'views/components/component_kit/CWPopoverMenu'; diff --git a/packages/commonwealth/client/styles/components/proposal_pills.scss b/packages/commonwealth/client/scripts/views/components/proposal_pills.scss similarity index 94% rename from packages/commonwealth/client/styles/components/proposal_pills.scss rename to packages/commonwealth/client/scripts/views/components/proposal_pills.scss index 0a4edb561aa..44c23789776 100644 --- a/packages/commonwealth/client/styles/components/proposal_pills.scss +++ b/packages/commonwealth/client/scripts/views/components/proposal_pills.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .ActiveProposalPill { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/proposal_pills.tsx b/packages/commonwealth/client/scripts/views/components/proposal_pills.tsx index 11fc9d99ee5..42b10743596 100644 --- a/packages/commonwealth/client/scripts/views/components/proposal_pills.tsx +++ b/packages/commonwealth/client/scripts/views/components/proposal_pills.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/proposal_pills.scss'; +import './proposal_pills.scss'; import { formatTimestamp } from 'helpers'; import moment from 'moment'; @@ -25,6 +25,7 @@ export const ActiveProposalPill = (props: ActiveProposalPillProps) => { type ClosedProposalPillProps = { proposalState: string }; +// eslint-disable-next-line react/no-multi-comp export const ClosedProposalPill = (props: ClosedProposalPillProps) => { const { proposalState } = props; diff --git a/packages/commonwealth/client/styles/components/proposals/proposal_extensions.scss b/packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.scss similarity index 67% rename from packages/commonwealth/client/styles/components/proposals/proposal_extensions.scss rename to packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.scss index fb49266d8bc..860760606de 100644 --- a/packages/commonwealth/client/styles/components/proposals/proposal_extensions.scss +++ b/packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProposalExtensions { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.tsx b/packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.tsx index 59eeb4ba181..b71f345a5b2 100644 --- a/packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.tsx +++ b/packages/commonwealth/client/scripts/views/components/proposals/proposal_extensions.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; -import 'components/proposals/proposal_extensions.scss'; import type { AnyProposal } from '../../../models/types'; +import './proposal_extensions.scss'; import app from 'state'; diff --git a/packages/commonwealth/client/styles/components/proposals/vote_listing.scss b/packages/commonwealth/client/scripts/views/components/proposals/vote_listing.scss similarity index 90% rename from packages/commonwealth/client/styles/components/proposals/vote_listing.scss rename to packages/commonwealth/client/scripts/views/components/proposals/vote_listing.scss index 0c74c1a913f..f417d24e14d 100644 --- a/packages/commonwealth/client/styles/components/proposals/vote_listing.scss +++ b/packages/commonwealth/client/scripts/views/components/proposals/vote_listing.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .VoteListing { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/proposals/vote_listing.tsx b/packages/commonwealth/client/scripts/views/components/proposals/vote_listing.tsx index 0a83ae3ad3c..802697e5254 100644 --- a/packages/commonwealth/client/scripts/views/components/proposals/vote_listing.tsx +++ b/packages/commonwealth/client/scripts/views/components/proposals/vote_listing.tsx @@ -3,12 +3,12 @@ import React from 'react'; // TODO: remove formatCoin, only use coins.format() import { formatCoin } from 'adapters/currency'; -import 'components/proposals/vote_listing.scss'; import { CosmosVote } from 'controllers/chain/cosmos/gov/v1beta1/proposal-v1beta1'; import type { IVote } from '../../../models/interfaces'; import type { AnyProposal } from '../../../models/types'; import { VotingUnit } from '../../../models/types'; import { DepositVote } from '../../../models/votes'; +import './vote_listing.scss'; import Account from '../../../models/Account'; import { User } from '../../components/user/user'; diff --git a/packages/commonwealth/client/styles/components/proposals/voting_actions.scss b/packages/commonwealth/client/scripts/views/components/proposals/voting_actions.scss similarity index 93% rename from packages/commonwealth/client/styles/components/proposals/voting_actions.scss rename to packages/commonwealth/client/scripts/views/components/proposals/voting_actions.scss index 815d71f02b7..90f7014b7ab 100644 --- a/packages/commonwealth/client/styles/components/proposals/voting_actions.scss +++ b/packages/commonwealth/client/scripts/views/components/proposals/voting_actions.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .CannotVote { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/components/proposals/voting_actions.tsx b/packages/commonwealth/client/scripts/views/components/proposals/voting_actions.tsx index 1cdf1d257e8..b2760abe653 100644 --- a/packages/commonwealth/client/scripts/views/components/proposals/voting_actions.tsx +++ b/packages/commonwealth/client/scripts/views/components/proposals/voting_actions.tsx @@ -1,4 +1,3 @@ -import 'components/proposals/voting_actions.scss'; import { notifyError } from 'controllers/app/notifications'; import type CosmosAccount from 'controllers/chain/cosmos/account'; import type Cosmos from 'controllers/chain/cosmos/adapter'; @@ -12,6 +11,7 @@ import React, { useState } from 'react'; import { MixpanelGovernanceEvents } from 'shared/analytics/types'; import type { AnyProposal } from '../../../models/types'; import { VotingType } from '../../../models/types'; +import './voting_actions.scss'; import app from 'state'; diff --git a/packages/commonwealth/client/styles/components/proposals/voting_result_components.scss b/packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.scss similarity index 96% rename from packages/commonwealth/client/styles/components/proposals/voting_result_components.scss rename to packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.scss index b1bf4942198..b18a0c64781 100644 --- a/packages/commonwealth/client/styles/components/proposals/voting_result_components.scss +++ b/packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin resultsColumnStyles { background-color: $neutral-100; diff --git a/packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.tsx b/packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.tsx index a3f21b54842..97920a7b9e3 100644 --- a/packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.tsx +++ b/packages/commonwealth/client/scripts/views/components/proposals/voting_result_components.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import 'components/proposals/voting_result_components.scss'; import type { CosmosProposal, CosmosVote, } from 'controllers/chain/cosmos/gov/v1beta1/proposal-v1beta1'; +import './voting_result_components.scss'; import type { IVote } from '../../../models/interfaces'; import type { AnyProposal } from '../../../models/types'; diff --git a/packages/commonwealth/client/styles/components/react_quill/markdown_formatted_text.scss b/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.scss similarity index 98% rename from packages/commonwealth/client/styles/components/react_quill/markdown_formatted_text.scss rename to packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.scss index ae435c818d0..4b0b94b05e4 100644 --- a/packages/commonwealth/client/styles/components/react_quill/markdown_formatted_text.scss +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.scss @@ -1,5 +1,5 @@ -@import '../../shared'; -@import 'quill_formatted_text.scss'; +@import '../../../styles/shared.scss'; +@import './quill_formatted_text.scss'; .MarkdownFormattedText { @include b2; diff --git a/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx b/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx index 2b9d7bfd4d1..87caef48ece 100644 --- a/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/markdown_formatted_text.tsx @@ -6,7 +6,7 @@ import React, { useState, } from 'react'; -import 'components/react_quill/markdown_formatted_text.scss'; +import './markdown_formatted_text.scss'; import DOMPurify from 'dompurify'; import { loadScript } from 'helpers'; diff --git a/packages/commonwealth/client/styles/components/react_quill/quill_formatted_text.scss b/packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.scss similarity index 99% rename from packages/commonwealth/client/styles/components/react_quill/quill_formatted_text.scss rename to packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.scss index 316a9403052..bda415a993d 100644 --- a/packages/commonwealth/client/styles/components/react_quill/quill_formatted_text.scss +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin formatted-text { @include b1; diff --git a/packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.tsx b/packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.tsx index cff3609c75e..f01224f2afe 100644 --- a/packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.tsx +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/quill_formatted_text.tsx @@ -1,8 +1,8 @@ import React, { useMemo, useState } from 'react'; -import 'components/react_quill/quill_formatted_text.scss'; import { CWIcon } from '../component_kit/cw_icons/cw_icon'; import { getClasses } from '../component_kit/helpers'; +import './quill_formatted_text.scss'; import { useCommonNavigate } from 'navigation/helpers'; import { DeltaStatic } from 'quill'; diff --git a/packages/commonwealth/client/styles/components/react_quill/react_quill_editor.scss b/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.scss similarity index 99% rename from packages/commonwealth/client/styles/components/react_quill/react_quill_editor.scss rename to packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.scss index 3a4398b0459..cce6a22d899 100644 --- a/packages/commonwealth/client/styles/components/react_quill/react_quill_editor.scss +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .CWEditor { .editor-and-tabs-container { diff --git a/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx b/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx index d90dd287cc8..81b6f897e41 100644 --- a/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx @@ -21,12 +21,12 @@ import { RTFtoMD, SerializableDeltaStatic, getTextFromDelta } from './utils'; import { useQuillPasteText } from './useQuillPasteText'; -import 'components/react_quill/react_quill_editor.scss'; import { useFormContext } from 'react-hook-form'; import 'react-quill/dist/quill.snow.css'; import { CWModal } from '../component_kit/new_designs/CWModal'; import { MessageRow } from '../component_kit/new_designs/CWTextInput/MessageRow'; import { MarkdownPreview } from './MarkdownPreview'; +import './react_quill_editor.scss'; import { LinkModal } from './LinkModal'; Quill.register('modules/magicUrl', MagicUrl); diff --git a/packages/commonwealth/client/scripts/views/components/react_quill_editor/toolbar.tsx b/packages/commonwealth/client/scripts/views/components/react_quill_editor/toolbar.tsx index d45d9e49dcf..7f0337a09bc 100644 --- a/packages/commonwealth/client/scripts/views/components/react_quill_editor/toolbar.tsx +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/toolbar.tsx @@ -14,10 +14,10 @@ import { TextStrikethrough, } from '@phosphor-icons/react'; import clsx from 'clsx'; -import 'components/react_quill/react_quill_editor.scss'; import { DeltaStatic } from 'quill'; import React, { MutableRefObject, useMemo } from 'react'; import ReactQuill from 'react-quill'; +import './react_quill_editor.scss'; import { SerializableDeltaStatic, renderToolbarIcon } from './utils'; const quillIcons = ReactQuill.Quill.import('ui/icons'); diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.scss b/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.scss index aa082e12b3d..675b5068482 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .AccountConnectionIndicator { .status-address { @@ -16,7 +16,7 @@ .status-row { display: flex; align-items: center; - margin: 8px 24px 16px; + margin: 8px 12px 16px; .status-light { width: 8px; @@ -34,10 +34,20 @@ cursor: pointer; } } + + .referral-link-button { + .Text { + font-weight: 400 !important; + } + } } .status-button { padding: 16px; border-bottom: 1px solid $neutral-200; + display: flex; + flex-direction: row; + justify-items: center; + align-items: center; } } diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.tsx index de83f84f8c0..dfdecb639ab 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/AccountConnectionIndicator/AccountConnectionIndicator.tsx @@ -1,14 +1,17 @@ import { WalletId } from '@hicommonwealth/shared'; +import { useFlag } from 'client/scripts/hooks/useFlag'; import { saveToClipboard } from 'client/scripts/utils/clipboard'; import clsx from 'clsx'; import { Magic } from 'magic-sdk'; import React from 'react'; import useUserStore from 'state/ui/user'; +import { useInviteLinkModal } from 'state/ui/modals'; import useJoinCommunity from 'views/components/SublayoutHeader/useJoinCommunity'; import { CWText } from 'views/components/component_kit/cw_text'; import { CWButton } from 'views/components/component_kit/new_designs/CWButton'; import { CWIdentificationTag } from 'views/components/component_kit/new_designs/CWIdentificationTag'; import { handleMouseEnter, handleMouseLeave } from 'views/menus/utils'; +import { SharePopover } from '../../SharePopover'; import CWIconButton from '../../component_kit/new_designs/CWIconButton'; import { CWTooltip } from '../../component_kit/new_designs/CWTooltip'; import './AccountConnectionIndicator.scss'; @@ -25,6 +28,8 @@ const AccountConnectionIndicator = ({ address, }: AccountConnectionIndicatorProps) => { const { handleJoinCommunity, JoinCommunityModals } = useJoinCommunity(); + const referralsEnabled = useFlag('referrals'); + const { setIsInviteLinkModalOpen } = useInviteLinkModal(); const userData = useUserStore(); const hasMagic = userData.addresses?.[0]?.walletId === WalletId.Magic; @@ -99,6 +104,17 @@ const AccountConnectionIndicator = ({ /> )}
+ + {referralsEnabled && ( + setIsInviteLinkModalOpen(true)} + /> + )}
)} @@ -111,6 +127,7 @@ const AccountConnectionIndicator = ({ disabled={connected} onClick={handleJoinCommunity} /> +
{JoinCommunityModals} diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/CollapsableSidebarButton/CollapsableSidebarButton.scss b/packages/commonwealth/client/scripts/views/components/sidebar/CollapsableSidebarButton/CollapsableSidebarButton.scss index 768f65ef5c9..88c4236157a 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/CollapsableSidebarButton/CollapsableSidebarButton.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CollapsableSidebarButton/CollapsableSidebarButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .CollapsableSidebarButton { svg { diff --git a/packages/commonwealth/client/styles/components/sidebar/CommunitySection/CommunitySection.scss b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.scss similarity index 94% rename from packages/commonwealth/client/styles/components/sidebar/CommunitySection/CommunitySection.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.scss index 82c08562805..36422d47ad6 100644 --- a/packages/commonwealth/client/styles/components/sidebar/CommunitySection/CommunitySection.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .community-menu { background-color: $neutral-25; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx index 92eca6391fe..48404f6ad17 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySection.tsx @@ -1,5 +1,4 @@ import { TokenView } from '@hicommonwealth/schemas'; -import 'components/sidebar/CommunitySection/CommunitySection.scss'; import { findDenominationString } from 'helpers/findDenomination'; import { useFlag } from 'hooks/useFlag'; import React from 'react'; @@ -28,6 +27,7 @@ import DirectoryMenuItem from '../DirectoryMenuItem'; import { DiscussionSection } from '../discussion_section'; import { ExternalLinksModule } from '../external_links_module'; import { GovernanceSection } from '../governance_section'; +import './CommunitySection.scss'; import { CommunitySectionSkeleton } from './CommunitySectionSkeleton'; import { TokenTradeWidget } from './TokenTradeWidget'; @@ -125,12 +125,11 @@ export const CommunitySection = ({ showSkeleton }: CommunitySectionProps) => { topicIdsIncludedInContest={topicIdsIncludedInContest} /> - + diff --git a/packages/commonwealth/client/styles/components/sidebar/CommunitySection/CommunitySectionSkeleton.scss b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.scss similarity index 80% rename from packages/commonwealth/client/styles/components/sidebar/CommunitySection/CommunitySectionSkeleton.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.scss index 5ecc6c2e7bb..caf7db7e5e2 100644 --- a/packages/commonwealth/client/styles/components/sidebar/CommunitySection/CommunitySectionSkeleton.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.scss @@ -1,4 +1,4 @@ -@import '../../../shared'; +@import '../../../../styles/shared.scss'; .community-menu-skeleton { padding: 16px; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.tsx index 6cb91a9cc33..6aca17bd1ce 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/CommunitySectionSkeleton.tsx @@ -1,11 +1,16 @@ -import 'components/sidebar/CommunitySection/CommunitySectionSkeleton.scss'; import React from 'react'; import { Skeleton } from '../../Skeleton'; +import './CommunitySectionSkeleton.scss'; + +type CommunitySectionSkeletonProps = { + sections?: number; + itemsPerSection?: number; +}; export const CommunitySectionSkeleton = ({ sections = 3, itemsPerSection = 5, -}) => { +}: CommunitySectionSkeletonProps) => { return (
@@ -16,11 +21,11 @@ export const CommunitySectionSkeleton = ({ }`} key={index} > - +
{Array.from({ length: itemsPerSection }).map((n, i) => (
- +
))}
diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/TokenTradeWidget/TokenTradeWidget.scss b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/TokenTradeWidget/TokenTradeWidget.scss index a26a0454efd..49b2dd1e357 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/TokenTradeWidget/TokenTradeWidget.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CommunitySection/TokenTradeWidget/TokenTradeWidget.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .TokenTradeWidget { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/CreateCommunityButton/CreateCommunityButton.scss b/packages/commonwealth/client/scripts/views/components/sidebar/CreateCommunityButton/CreateCommunityButton.scss index c33f2611a82..71e661f04d6 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/CreateCommunityButton/CreateCommunityButton.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/CreateCommunityButton/CreateCommunityButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .CreateCommunityButton { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/TokenLaunchButton/TokenLaunchButton.scss b/packages/commonwealth/client/scripts/views/components/sidebar/TokenLaunchButton/TokenLaunchButton.scss index e8955814531..d6d349fa8a3 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/TokenLaunchButton/TokenLaunchButton.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/TokenLaunchButton/TokenLaunchButton.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .TokenLaunchButton { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/discussion_section.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/discussion_section.tsx index 59f28f8a17f..1dbab2471bf 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/discussion_section.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/discussion_section.tsx @@ -16,7 +16,7 @@ import type { ToggleTree, } from './types'; -import 'components/sidebar/index.scss'; +import './index.scss'; const resetSidebarState = () => { if (isWindowSmallInclusive(window.innerWidth)) { @@ -43,11 +43,9 @@ function setDiscussionsToggleTree(path: string, toggle: boolean) { JSON.stringify(newTree); } interface DiscussionSectionProps { - isContestAvailable: boolean; topicIdsIncludedInContest: number[]; } export const DiscussionSection = ({ - isContestAvailable, topicIdsIncludedInContest, }: DiscussionSectionProps) => { const navigate = useCommonNavigate(); @@ -56,10 +54,7 @@ export const DiscussionSection = ({ [{ path: '/discussions' }, { path: ':scope/discussions' }], location, ); - const matchesContestsRoute = matchRoutes( - [{ path: '/contests' }, { path: ':scope/contests' }], - location, - ); + const matchesArchivedRoute = matchRoutes( [{ path: '/archived' }, { path: ':scope/archived' }], location, @@ -134,35 +129,6 @@ export const DiscussionSection = ({ }, displayData: null, }, - ...(isContestAvailable - ? [ - { - title: 'Contests', - containsChildren: false, - displayData: null, - hasDefaultToggle: false, - isActive: !!matchesContestsRoute, - isVisible: true, - isUpdated: true, - onClick: (e, toggle: boolean) => { - e.preventDefault(); - resetSidebarState(); - handleRedirectClicks( - navigate, - e, - `/contests`, - communityId, - () => { - setDiscussionsToggleTree( - `children.Contests.toggledState`, - toggle, - ); - }, - ); - }, - }, - ] - : []), ]; for (const topic of topics) { diff --git a/packages/commonwealth/client/styles/components/sidebar/explore_sidebar.scss b/packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.scss similarity index 95% rename from packages/commonwealth/client/styles/components/sidebar/explore_sidebar.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.scss index 886920fdfbb..57d47afedee 100644 --- a/packages/commonwealth/client/styles/components/sidebar/explore_sidebar.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ExploreCommunitiesSidebar { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.tsx index 4986bce0ce3..44965b02585 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/explore_sidebar.tsx @@ -1,10 +1,10 @@ -import 'components/sidebar/explore_sidebar.scss'; import React from 'react'; import useSidebarStore, { sidebarStore } from 'state/ui/sidebar'; import useUserStore from 'state/ui/user'; import { CWSidebarMenu } from '../component_kit/cw_sidebar_menu'; import { getClasses } from '../component_kit/helpers'; import type { MenuItem } from '../component_kit/types'; +import './explore_sidebar.scss'; export const ExploreCommunitiesSidebar = ({ isInsideCommunity, diff --git a/packages/commonwealth/client/styles/components/sidebar/external_links_module.scss b/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.scss similarity index 93% rename from packages/commonwealth/client/styles/components/sidebar/external_links_module.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.scss index 8fc8c76c4ab..4c53a37dd31 100644 --- a/packages/commonwealth/client/styles/components/sidebar/external_links_module.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ExternalLinksModule { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx index 8a419f2409f..40af620b1d9 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx @@ -1,10 +1,10 @@ -import 'components/sidebar/external_links_module.scss'; import { categorizeSocialLinks } from 'helpers/link'; import React from 'react'; import app from 'state'; import { useGetCommunityByIdQuery } from 'state/api/communities'; import { CWIcon } from '../component_kit/cw_icons/cw_icon'; import CWCircleMultiplySpinner from '../component_kit/new_designs/CWCircleMultiplySpinner'; +import './external_links_module.scss'; export const ExternalLinksModule = () => { const { data: community, isLoading } = useGetCommunityByIdQuery({ diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/governance_section.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/governance_section.tsx index 670bdae6ffc..a507d56d813 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/governance_section.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/governance_section.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { ChainBase, ChainNetwork, ChainType } from '@hicommonwealth/shared'; -import 'components/sidebar/index.scss'; import { handleRedirectClicks } from 'helpers'; +import './index.scss'; import { useCommonNavigate } from 'navigation/helpers'; import { matchRoutes, useLocation } from 'react-router-dom'; @@ -18,7 +18,9 @@ import type { SidebarSectionAttrs, ToggleTree, } from './types'; - +interface AppSectionProps { + isContestAvailable: boolean; +} const resetSidebarState = () => { if (isWindowSmallInclusive(window.innerWidth)) { sidebarStore.getState().setMenu({ name: 'default', isVisible: false }); @@ -50,7 +52,7 @@ function setGovernanceToggleTree(path: string, toggle: boolean) { JSON.stringify(newTree); } -export const GovernanceSection = () => { +export const GovernanceSection = ({ isContestAvailable }: AppSectionProps) => { const navigate = useCommonNavigate(); const location = useLocation(); @@ -97,6 +99,12 @@ export const GovernanceSection = () => { children: {}, }, }), + ...(isContestAvailable && { + Contests: { + toggledState: false, + children: {}, + }, + }), }, }; @@ -129,7 +137,10 @@ export const GovernanceSection = () => { [{ path: '/members' }, { path: ':scope/members' }], location, ); - + const matchesContestsRoute = matchRoutes( + [{ path: '/contests' }, { path: ':scope/contests' }], + location, + ); // ---------- Build Section Props ---------- // // Members @@ -221,18 +232,38 @@ export const GovernanceSection = () => { isActive: !!matchesProposalRoute, displayData: null, }; - + //Contests + const contestData: SectionGroupAttrs = { + title: 'Contests', + containsChildren: false, + displayData: null, + hasDefaultToggle: false, + isActive: !!matchesContestsRoute, + isVisible: true, + isUpdated: true, + onClick: (e, toggle: boolean) => { + e.preventDefault(); + resetSidebarState(); + handleRedirectClicks(navigate, e, `/contests`, communityId, () => { + setGovernanceToggleTree('children.Contests.toggledState', toggle); + }); + }, + }; let governanceGroupData: SectionGroupAttrs[] = [ membersData, snapshotData, proposalsData, + contestData, ]; if (!hasProposals) governanceGroupData = [membersData]; + if (isContestAvailable) { + governanceGroupData.push(contestData); + } const sidebarSectionData: SidebarSectionAttrs = { - title: 'Governance', - className: 'GovernanceSection', + title: 'Apps', + className: 'AppsSection', hasDefaultToggle: toggleTreeState['toggledState'], onClick: (e, toggle: boolean) => { e.preventDefault(); diff --git a/packages/commonwealth/client/styles/components/sidebar/index.scss b/packages/commonwealth/client/scripts/views/components/sidebar/index.scss similarity index 98% rename from packages/commonwealth/client/styles/components/sidebar/index.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/index.scss index d4cec662618..4468e0aeedf 100644 --- a/packages/commonwealth/client/styles/components/sidebar/index.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/index.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .Sidebar { display: flex; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/index.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/index.tsx index fb12d541e7f..e5d36ac80b6 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/index.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/index.tsx @@ -1,5 +1,4 @@ import clsx from 'clsx'; -import 'components/sidebar/index.scss'; import React, { useEffect, useMemo } from 'react'; import app from 'state'; import useSidebarStore from 'state/ui/sidebar'; @@ -7,6 +6,7 @@ import { CreateContentSidebar } from '../../menus/CreateContentMenu'; import { SidebarHeader } from '../component_kit/CWSidebarHeader'; import { CommunitySection } from './CommunitySection'; import { ExploreCommunitiesSidebar } from './explore_sidebar'; +import './index.scss'; import { SidebarQuickSwitcher } from './sidebar_quick_switcher'; export type SidebarMenuName = diff --git a/packages/commonwealth/client/styles/components/sidebar/sidebar_quick_switcher.scss b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss similarity index 94% rename from packages/commonwealth/client/styles/components/sidebar/sidebar_quick_switcher.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss index 971dd0908fc..ba0b366d2fe 100644 --- a/packages/commonwealth/client/styles/components/sidebar/sidebar_quick_switcher.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .SidebarQuickSwitcher { background: $neutral-50; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx index 6d9a7582fa0..849cce38499 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_quick_switcher.tsx @@ -1,5 +1,4 @@ import clsx from 'clsx'; -import 'components/sidebar/sidebar_quick_switcher.scss'; import { navigateToCommunity, useCommonNavigate } from 'navigation/helpers'; import React from 'react'; import useSidebarStore from 'state/ui/sidebar'; @@ -7,6 +6,7 @@ import useUserStore from 'state/ui/user'; import { CWCommunityAvatar } from '../component_kit/cw_community_avatar'; import { CWDivider } from '../component_kit/cw_divider'; import { CWIconButton } from '../component_kit/cw_icon_button'; +import './sidebar_quick_switcher.scss'; export const SidebarQuickSwitcher = ({ isInsideCommunity, diff --git a/packages/commonwealth/client/styles/components/sidebar/sidebar_section.scss b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.scss similarity index 98% rename from packages/commonwealth/client/styles/components/sidebar/sidebar_section.scss rename to packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.scss index 9378218bc23..822c666bc2e 100644 --- a/packages/commonwealth/client/styles/components/sidebar/sidebar_section.scss +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .SidebarSectionGroup { border-bottom-color: $neutral-50; diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.tsx index 2c42f5b799f..262b9138f7a 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/sidebar_section.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import React from 'react'; -import 'components/sidebar/sidebar_section.scss'; +import './sidebar_section.scss'; import { isNotUndefined } from 'helpers/typeGuards'; import useSidebarStore from 'state/ui/sidebar'; @@ -49,6 +49,7 @@ const SubSection = (props: SubSectionAttrs) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const SubSectionGroup = (props: SectionGroupAttrs) => { const { containsChildren, @@ -153,6 +154,7 @@ export const SubSectionGroup = (props: SectionGroupAttrs) => { ); }; +// eslint-disable-next-line react/no-multi-comp export const SidebarSectionGroup = (props: SidebarSectionAttrs) => { const { displayData, diff --git a/packages/commonwealth/client/styles/components/snapshot_proposal_selector.scss b/packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.scss similarity index 94% rename from packages/commonwealth/client/styles/components/snapshot_proposal_selector.scss rename to packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.scss index 2cc4a77ba3e..b5c87ffce50 100644 --- a/packages/commonwealth/client/styles/components/snapshot_proposal_selector.scss +++ b/packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../../styles/shared.scss'; .SnapshotProposalSelector { border-radius: $border-radius-corners; diff --git a/packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.tsx b/packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.tsx index 523d586dd66..ad8f472b6e4 100644 --- a/packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.tsx +++ b/packages/commonwealth/client/scripts/views/components/snapshot_proposal_selector/snapshot_proposal_selector.tsx @@ -1,8 +1,8 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import 'components/snapshot_proposal_selector.scss'; import type { SnapshotProposal } from 'helpers/snapshot_utils'; import { loadMultipleSpacesData } from 'helpers/snapshot_utils'; +import './snapshot_proposal_selector.scss'; import app from 'state'; import { QueryList } from 'views/components/component_kit/cw_query_list'; diff --git a/packages/commonwealth/client/styles/components/social_accounts.scss b/packages/commonwealth/client/scripts/views/components/social_accounts.scss similarity index 84% rename from packages/commonwealth/client/styles/components/social_accounts.scss rename to packages/commonwealth/client/scripts/views/components/social_accounts.scss index 4ac7f35527f..b25d83ee329 100644 --- a/packages/commonwealth/client/styles/components/social_accounts.scss +++ b/packages/commonwealth/client/scripts/views/components/social_accounts.scss @@ -1,11 +1,10 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .SocialAccounts { display: flex; max-width: 240px; justify-content: center; flex-wrap: wrap; - margin: 16px auto 16px; .social-icon { fill: $neutral-500; diff --git a/packages/commonwealth/client/scripts/views/components/social_accounts.tsx b/packages/commonwealth/client/scripts/views/components/social_accounts.tsx index 7636a366a52..da46021b09b 100644 --- a/packages/commonwealth/client/scripts/views/components/social_accounts.tsx +++ b/packages/commonwealth/client/scripts/views/components/social_accounts.tsx @@ -1,7 +1,7 @@ -import 'components/social_accounts.scss'; import React from 'react'; import type NewProfile from '../../models/NewProfile'; import { SocialAccount } from './SocialAccount'; +import './social_accounts.scss'; type SocialAccountsProps = { profile: NewProfile; diff --git a/packages/commonwealth/client/styles/pages/terms_banner.scss b/packages/commonwealth/client/scripts/views/components/terms_banner.scss similarity index 64% rename from packages/commonwealth/client/styles/pages/terms_banner.scss rename to packages/commonwealth/client/scripts/views/components/terms_banner.scss index 00ca6fcce3a..06f5bb47083 100644 --- a/packages/commonwealth/client/styles/pages/terms_banner.scss +++ b/packages/commonwealth/client/scripts/views/components/terms_banner.scss @@ -1,5 +1,5 @@ -@import '../shared'; -@import '../components/component_kit/cw_banner.scss'; +@import '../../styles/shared.scss'; +@import './component_kit/cw_banner.scss'; .TermsBanner.Banner { @include bannerStyles; diff --git a/packages/commonwealth/client/scripts/views/components/terms_banner.tsx b/packages/commonwealth/client/scripts/views/components/terms_banner.tsx index 407a77e0b9c..2d323e9cbcd 100644 --- a/packages/commonwealth/client/scripts/views/components/terms_banner.tsx +++ b/packages/commonwealth/client/scripts/views/components/terms_banner.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import 'pages/terms_banner.scss'; +import './terms_banner.scss'; import app from 'state'; import { Old_CWBanner } from './component_kit/cw_banner'; @@ -12,7 +12,7 @@ export const TermsBanner = ({ terms }: TermsBannerProps) => { const localStorageId = `${app.activeChainId()}-tos`; const [isVisible, setIsVisible] = useState( - localStorage.getItem(localStorageId) + localStorage.getItem(localStorageId), ); const handleClickDismiss = () => { diff --git a/packages/commonwealth/client/styles/components/thread_selector.scss b/packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.scss similarity index 94% rename from packages/commonwealth/client/styles/components/thread_selector.scss rename to packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.scss index bb3686f4bc2..187e6524645 100644 --- a/packages/commonwealth/client/styles/components/thread_selector.scss +++ b/packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../../styles/shared.scss'; .ThreadSelector { border-radius: $border-radius-corners; diff --git a/packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.tsx b/packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.tsx index 2ceaace4801..ca6f66016c5 100644 --- a/packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.tsx +++ b/packages/commonwealth/client/scripts/views/components/thread_selector/thread_selector.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useMemo, useState } from 'react'; -import 'components/thread_selector.scss'; import AddressInfo from 'models/AddressInfo'; import app from 'state'; import { useDebounce } from 'usehooks-ts'; @@ -13,6 +12,7 @@ import { import { useSearchThreadsQuery } from '../../../../scripts/state/api/threads'; import Thread from '../../../models/Thread'; import { CWTextInput } from '../component_kit/cw_text_input'; +import './thread_selector.scss'; type ThreadSelectorProps = { linkedThreadsToSet: Array; diff --git a/packages/commonwealth/client/scripts/views/components/token_decimal_input.tsx b/packages/commonwealth/client/scripts/views/components/token_decimal_input.tsx deleted file mode 100644 index e700bd1b45d..00000000000 --- a/packages/commonwealth/client/scripts/views/components/token_decimal_input.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { useEffect } from 'react'; - -import 'components/token_decimal_input.scss'; - -import { tokensToWei, weiToTokens } from 'helpers'; -import { CWText } from './component_kit/cw_text'; -import { CWTextInput } from './component_kit/cw_text_input'; -import { CWToggle } from './component_kit/cw_toggle'; - -type TokenDecimalInputProps = { - decimals: number; - defaultValueInWei: string; - onInputChange: (valueInWei: string) => void; -}; - -export const TokenDecimalInput = (props: TokenDecimalInputProps) => { - const { defaultValueInWei, onInputChange, decimals } = props; - - const [displayValue, setDisplayValue] = React.useState( - defaultValueInWei || '0' - ); - const [isInputInWei, setIsInputInWei] = React.useState(false); - const [caption, setCaption] = React.useState( - `Using ${decimals} decimal precision` - ); - const [valueInWei, setValueInWei] = React.useState( - defaultValueInWei || '0' - ); - - useEffect(() => { - if (isInputInWei) { - setCaption('Using base token value'); - // token -> wei - setDisplayValue(tokensToWei(displayValue, decimals)); - } else { - setCaption(`Using ${decimals} decimal precision`); - // wei -> token - setDisplayValue(weiToTokens(displayValue, decimals)); - } - }, [isInputInWei]); - - useEffect(() => { - onInputChange(valueInWei); - }, [valueInWei]); - - return ( -
- { - v.preventDefault(); - // restrict it to numerical input - const wholeNumberTest = /^[1-9]\d*$/; - const decimalTest = /^\d+\.?\d*$/; - if ( - v.target.value === '' || - v.target.value === '0' || - (isInputInWei ? wholeNumberTest : decimalTest).test(v.target.value) - ) { - const inputNumber = v.target.value; - - setDisplayValue(inputNumber); - - try { - setValueInWei( - isInputInWei || !inputNumber - ? inputNumber - : tokensToWei(inputNumber, decimals) - ); - } catch (err) { - console.log(`Input conversion failed: ${v.target.value}`); - } - } else { - console.log(`Invalid input string: ${v.target.value}`); - } - }} - /> - {decimals > 0 && ( -
- { - setIsInputInWei(!isInputInWei); - }} - /> - - {caption} - -
- )} -
- ); -}; diff --git a/packages/commonwealth/client/styles/components/topic_selector.scss b/packages/commonwealth/client/scripts/views/components/topic_selector.scss similarity index 56% rename from packages/commonwealth/client/styles/components/topic_selector.scss rename to packages/commonwealth/client/scripts/views/components/topic_selector.scss index 1712d7ff06f..911d68cca3f 100644 --- a/packages/commonwealth/client/styles/components/topic_selector.scss +++ b/packages/commonwealth/client/scripts/views/components/topic_selector.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .TopicSelector { flex: 1; diff --git a/packages/commonwealth/client/scripts/views/components/topic_selector.tsx b/packages/commonwealth/client/scripts/views/components/topic_selector.tsx index 0217d0ff270..2561d69dddc 100644 --- a/packages/commonwealth/client/scripts/views/components/topic_selector.tsx +++ b/packages/commonwealth/client/scripts/views/components/topic_selector.tsx @@ -1,8 +1,8 @@ import React from 'react'; import type { Topic } from '../../models/Topic'; -import 'components/topic_selector.scss'; import { SelectList } from 'views/components/component_kit/cw_select_list'; +import './topic_selector.scss'; interface TopicSelectorProps { enabledTopics: Topic[]; diff --git a/packages/commonwealth/client/scripts/views/components/user/UserSkeleton.tsx b/packages/commonwealth/client/scripts/views/components/user/UserSkeleton.tsx index 6da0405a462..0d312c4c989 100644 --- a/packages/commonwealth/client/scripts/views/components/user/UserSkeleton.tsx +++ b/packages/commonwealth/client/scripts/views/components/user/UserSkeleton.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'components/user/user.scss'; +import './user.scss'; import { Avatar } from 'views/components/Avatar'; import { Skeleton } from '../Skeleton'; @@ -18,7 +18,7 @@ export const UserSkeleton = ({ if (shouldShowAvatarOnly) { return (
- +
); } @@ -27,10 +27,10 @@ export const UserSkeleton = ({ const userInfo = (
{!shouldHideAvatar && ( - + )}
- +
); diff --git a/packages/commonwealth/client/scripts/views/components/user/fullUser.tsx b/packages/commonwealth/client/scripts/views/components/user/fullUser.tsx index b2cb4681f60..022e3e263e5 100644 --- a/packages/commonwealth/client/scripts/views/components/user/fullUser.tsx +++ b/packages/commonwealth/client/scripts/views/components/user/fullUser.tsx @@ -2,7 +2,6 @@ import { ChainBase, DEFAULT_NAME } from '@hicommonwealth/shared'; import ghostSvg from 'assets/img/ghost.svg'; import { saveToClipboard } from 'client/scripts/utils/clipboard'; import clsx from 'clsx'; -import 'components/user/user.scss'; import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import app from 'state'; @@ -21,6 +20,7 @@ import { CWText } from '../component_kit/cw_text'; import { CWModal } from '../component_kit/new_designs/CWModal'; import { CWTooltip } from '../component_kit/new_designs/CWTooltip'; import { UserSkeleton } from './UserSkeleton'; +import './user.scss'; import { FullUserAttrsWithSkeletonProp } from './user.types'; // TODO: When we remove all usages of User component (user.tsx). We should rename this file and component to User diff --git a/packages/commonwealth/client/styles/components/user/user.scss b/packages/commonwealth/client/scripts/views/components/user/user.scss similarity index 98% rename from packages/commonwealth/client/styles/components/user/user.scss rename to packages/commonwealth/client/scripts/views/components/user/user.scss index 107ee2f0a3a..381e7f24a6b 100644 --- a/packages/commonwealth/client/styles/components/user/user.scss +++ b/packages/commonwealth/client/scripts/views/components/user/user.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin bareAvatar { position: relative; diff --git a/packages/commonwealth/client/scripts/views/components/user/user.tsx b/packages/commonwealth/client/scripts/views/components/user/user.tsx index d6dc5c081d4..09fdc34260f 100644 --- a/packages/commonwealth/client/scripts/views/components/user/user.tsx +++ b/packages/commonwealth/client/scripts/views/components/user/user.tsx @@ -1,6 +1,5 @@ import { ChainBase, DEFAULT_NAME } from '@hicommonwealth/shared'; import ghostSvg from 'assets/img/ghost.svg'; -import 'components/user/user.scss'; import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import app from 'state'; @@ -18,6 +17,7 @@ import { CWText } from '../component_kit/cw_text'; import { CWButton } from '../component_kit/new_designs/CWButton'; import { CWModal } from '../component_kit/new_designs/CWModal'; import { UserSkeleton } from './UserSkeleton'; +import './user.scss'; import type { UserAttrsWithSkeletonProp } from './user.types'; // TODO: When this is no longer used, this should be removed in favour of fullUser.tsx diff --git a/packages/commonwealth/client/styles/components/user/user_gallery.scss b/packages/commonwealth/client/scripts/views/components/user/user_gallery.scss similarity index 91% rename from packages/commonwealth/client/styles/components/user/user_gallery.scss rename to packages/commonwealth/client/scripts/views/components/user/user_gallery.scss index aba4f8403ef..23d464ecf60 100644 --- a/packages/commonwealth/client/styles/components/user/user_gallery.scss +++ b/packages/commonwealth/client/scripts/views/components/user/user_gallery.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @import './user'; .UserGallery { diff --git a/packages/commonwealth/client/scripts/views/components/user/user_gallery.tsx b/packages/commonwealth/client/scripts/views/components/user/user_gallery.tsx index 7f7947220b6..d6f0653032b 100644 --- a/packages/commonwealth/client/scripts/views/components/user/user_gallery.tsx +++ b/packages/commonwealth/client/scripts/views/components/user/user_gallery.tsx @@ -1,6 +1,6 @@ -import 'components/user/user_gallery.scss'; import React from 'react'; import { User } from './user'; +import './user_gallery.scss'; type UserGalleryProps = { addressesCount?: number; diff --git a/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.scss b/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.scss index 7e73b3a88db..996d5821c34 100644 --- a/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.scss +++ b/packages/commonwealth/client/scripts/views/menus/CreateContentMenu/CreateContentMenu.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .create-content-popover { .TokenLaunchButton { diff --git a/packages/commonwealth/client/styles/modals/ArchiveThreadModal.scss b/packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.scss similarity index 93% rename from packages/commonwealth/client/styles/modals/ArchiveThreadModal.scss rename to packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.scss index 171daabc9e1..44651e0ce26 100644 --- a/packages/commonwealth/client/styles/modals/ArchiveThreadModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .ArchiveThreadModal { padding: 24px; @@ -34,5 +34,4 @@ justify-content: flex-end; } } - -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.tsx b/packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.tsx index 55ca31d3356..56a66a51d6e 100644 --- a/packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/ArchiveThreadModal.tsx @@ -1,10 +1,10 @@ -import 'modals/ArchiveThreadModal.scss'; import React from 'react'; import app from 'state'; import { useEditThreadMutation } from 'state/api/threads'; import type Thread from '../../models/Thread'; import { CWText } from '../components/component_kit/cw_text'; import { CWButton } from '../components/component_kit/new_designs/CWButton'; +import './ArchiveThreadModal.scss'; import { buildUpdateThreadInput } from 'client/scripts/state/api/threads/editThread'; import useUserStore from 'state/ui/user'; diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/CreateAccountModal/CreateAccountModal.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/CreateAccountModal/CreateAccountModal.scss index de92cb7d2b4..cebb0d7f6dc 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/CreateAccountModal/CreateAccountModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/CreateAccountModal/CreateAccountModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .CreateAccountModal { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/RevalidateSessionModal/RevalidateSessionModal.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/RevalidateSessionModal/RevalidateSessionModal.scss index 5a85522efab..a67a29a321e 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/RevalidateSessionModal/RevalidateSessionModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/RevalidateSessionModal/RevalidateSessionModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .RevalidateSessionModal { .auth-options { diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/SignInModal/SignInModal.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/SignInModal/SignInModal.scss index 4ca04686148..f7c1ebf2324 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/SignInModal/SignInModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/SignInModal/SignInModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .SignInModal { .tabs { diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EVMWalletsSubModal/EVMWalletsSubModal.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EVMWalletsSubModal/EVMWalletsSubModal.scss index 19fa240b47b..3971e4dc953 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EVMWalletsSubModal/EVMWalletsSubModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EVMWalletsSubModal/EVMWalletsSubModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .EVMWalletsSubModal { .CWModal { diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EmailForm/EmailForm.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EmailForm/EmailForm.scss index adb838f6ad9..6a177da3fc7 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EmailForm/EmailForm.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/EmailForm/EmailForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .EmailForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/MobileWalletConfirmationSubModal/MobileWalletConfirmationSubModal.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/MobileWalletConfirmationSubModal/MobileWalletConfirmationSubModal.scss index 10bf40a2e21..cacbf67d9d3 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/MobileWalletConfirmationSubModal/MobileWalletConfirmationSubModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/MobileWalletConfirmationSubModal/MobileWalletConfirmationSubModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .MobileWalletConfirmationSubModal { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/ModalBase.scss b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/ModalBase.scss index 65c264eecd4..9501c245f92 100644 --- a/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/ModalBase.scss +++ b/packages/commonwealth/client/scripts/views/modals/AuthModal/common/ModalBase/ModalBase.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ModalBase { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/InviteLinkModal.scss b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/InviteLinkModal.scss new file mode 100644 index 00000000000..e812fdbfaaf --- /dev/null +++ b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/InviteLinkModal.scss @@ -0,0 +1,67 @@ +@import '../../../styles/shared.scss'; + +.InviteLinkModal { + .content { + display: flex; + flex-direction: column; + gap: 16px; + } + + input, + svg { + cursor: pointer !important; + } + + input:read-only { + background-color: $neutral-50; + border-color: $neutral-200; + color: $neutral-400; + + &:hover { + border-color: $neutral-200; + } + + &:focus-within { + border-color: $neutral-200 !important; + box-shadow: none !important; + } + } + + .share-section { + .Text.bold { + margin-block: 16px; + } + + .share-options { + display: flex; + justify-content: space-between; + overflow-y: auto; + + .share-option { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + cursor: pointer; + padding: 12px; + transition: background-color 0.2s; + + .icon { + width: 48px; + height: 48px; + } + + .Text.caption { + color: $neutral-400; + white-space: nowrap; + justify-content: center; + } + + &:hover { + background-color: $neutral-50; + transition: background-color 0.2s; + } + } + } + } +} diff --git a/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/InviteLinkModal.tsx b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/InviteLinkModal.tsx new file mode 100644 index 00000000000..fda807a8883 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/InviteLinkModal.tsx @@ -0,0 +1,86 @@ +import React from 'react'; + +import { saveToClipboard } from 'utils/clipboard'; +import { CWIcon } from '../../components/component_kit/cw_icons/cw_icon'; +import { CWText } from '../../components/component_kit/cw_text'; +import { + CWModalBody, + CWModalFooter, + CWModalHeader, +} from '../../components/component_kit/new_designs/CWModal'; +import { CWTextInput } from '../../components/component_kit/new_designs/CWTextInput'; +import { getShareOptions } from './utils'; + +import './InviteLinkModal.scss'; + +interface InviteLinkModalProps { + onModalClose: () => void; + isInsideCommunity: boolean; +} + +const InviteLinkModal = ({ + onModalClose, + isInsideCommunity, +}: InviteLinkModalProps) => { + // TODO: replace with actual invite link from backend in upcoming PR + const inviteLink = 'https://commonwealth.im/~/invite/774037=89defcb8'; + + const handleCopy = () => { + saveToClipboard(inviteLink, true).catch(console.error); + }; + + const shareOptions = getShareOptions(isInsideCommunity, inviteLink); + + return ( +
+ + +
+ + {isInsideCommunity + ? 'Get more voting power in your communities when people join with your referral link.' + : `When you refer your friends to Common, you'll get a portion of any fees they pay to + Common over their lifetime engaging with web 3 native forums.`} + + + } + /> + +
+ Share to +
+ {shareOptions.map((option) => ( +
+ {option.name} + {option.name} +
+ ))} +
+
+
+
+ + <> + +
+ ); +}; + +export default InviteLinkModal; diff --git a/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/index.ts b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/index.ts new file mode 100644 index 00000000000..436e106b08f --- /dev/null +++ b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/index.ts @@ -0,0 +1,3 @@ +import InviteLinkModal from './InviteLinkModal'; + +export default InviteLinkModal; diff --git a/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/utils.ts b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/utils.ts new file mode 100644 index 00000000000..b2d6ffc856a --- /dev/null +++ b/packages/commonwealth/client/scripts/views/modals/InviteLinkModal/utils.ts @@ -0,0 +1,76 @@ +import mailImg from 'assets/img/share/mail.png'; +import messagesImg from 'assets/img/share/messages.png'; +import telegramImg from 'assets/img/share/telegram.png'; +import warpcastImg from 'assets/img/share/warpcast.png'; +import twitterImg from 'assets/img/share/x.png'; + +const inviteCommunityMessage = 'Hey, check out my community on Common!'; +const inviteCommonMessage = 'Hey, check out Common!'; + +const generatePermalink = (isInsideCommunity: boolean, inviteLink: string) => { + const message = isInsideCommunity + ? inviteCommunityMessage + : inviteCommonMessage; + + return `${message} \n${inviteLink}`; +}; + +interface ShareOption { + name: string; + icon: string; + onClick: () => void; +} + +export const getShareOptions = ( + isInsideCommunity: boolean, + inviteLink: string, +): ShareOption[] => [ + { + name: 'Messages', + icon: messagesImg, + onClick: () => + window.open( + `sms:?&body=${encodeURIComponent(generatePermalink(isInsideCommunity, inviteLink))}`, + ), + }, + { + name: 'Telegram', + icon: telegramImg, + onClick: () => + window.open( + `https://t.me/share/url?url=${encodeURIComponent( + generatePermalink(isInsideCommunity, inviteLink), + )}`, + ), + }, + { + name: 'X (Twitter)', + icon: twitterImg, + onClick: () => + window.open( + `https://twitter.com/intent/tweet?url=${encodeURIComponent( + generatePermalink(isInsideCommunity, inviteLink), + )}`, + ), + }, + { + name: 'Warpcast', + icon: warpcastImg, + onClick: () => + window.open( + `https://warpcast.com/~/compose?text=${encodeURIComponent( + generatePermalink(isInsideCommunity, inviteLink), + )}`, + ), + }, + { + name: 'Email', + icon: mailImg, + onClick: () => + window.open( + `mailto:?body=${encodeURIComponent( + generatePermalink(isInsideCommunity, inviteLink), + )}`, + ), + }, +]; diff --git a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/ManageCommunityStakeModal.scss b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/ManageCommunityStakeModal.scss index 7c587a7dbb3..d2ef58b9f66 100644 --- a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/ManageCommunityStakeModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/ManageCommunityStakeModal.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .ManageCommunityStakeModal { .CWModalHeader { diff --git a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/CustomAddressOption.scss b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/CustomAddressOption.scss index b2b805dfa2a..1e0eaed718e 100644 --- a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/CustomAddressOption.scss +++ b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/CustomAddressOption.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .CustomAddressOptionElement { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/StakeExchangeForm.scss b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/StakeExchangeForm.scss index 748f9303732..35ecca19cdd 100644 --- a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/StakeExchangeForm.scss +++ b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/StakeExchangeForm/StakeExchangeForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .StakeExchangeForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionFailed/TransactionFailed.scss b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionFailed/TransactionFailed.scss index 2645d509680..2a7ec8e4eb0 100644 --- a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionFailed/TransactionFailed.scss +++ b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionFailed/TransactionFailed.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .TransactionFailed { .CWModalBody { diff --git a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionLoading/TransactionLoading.scss b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionLoading/TransactionLoading.scss index 7bcc23f39a4..93e42f30690 100644 --- a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionLoading/TransactionLoading.scss +++ b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionLoading/TransactionLoading.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .TransactionLoading { .CWModalBody { diff --git a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionSucceeded/TransactionSucceeded.scss b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionSucceeded/TransactionSucceeded.scss index 7be344d16ee..55c1bb17076 100644 --- a/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionSucceeded/TransactionSucceeded.scss +++ b/packages/commonwealth/client/scripts/views/modals/ManageCommunityStakeModal/TransactionSucceeded/TransactionSucceeded.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .TransactionSucceeded { .CWModalBody { diff --git a/packages/commonwealth/client/scripts/views/modals/NewCommunityAdminModal/NewCommunityAdminModal.scss b/packages/commonwealth/client/scripts/views/modals/NewCommunityAdminModal/NewCommunityAdminModal.scss index 72bf00c1730..a1074d884a8 100644 --- a/packages/commonwealth/client/scripts/views/modals/NewCommunityAdminModal/NewCommunityAdminModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/NewCommunityAdminModal/NewCommunityAdminModal.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .NewCommunityAdminModal { .description { diff --git a/packages/commonwealth/client/scripts/views/modals/TOSModal/TOSModal.scss b/packages/commonwealth/client/scripts/views/modals/TOSModal/TOSModal.scss index 466005ea8fd..11b0ba4f5ad 100644 --- a/packages/commonwealth/client/scripts/views/modals/TOSModal/TOSModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/TOSModal/TOSModal.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .TOSModal { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/ThreadPreviewModal/ThreadPreviewModal.scss b/packages/commonwealth/client/scripts/views/modals/ThreadPreviewModal/ThreadPreviewModal.scss index 9a26d5cb3f0..1c7a5502ee9 100644 --- a/packages/commonwealth/client/scripts/views/modals/ThreadPreviewModal/ThreadPreviewModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/ThreadPreviewModal/ThreadPreviewModal.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .ThreadPreviewModal { position: fixed; diff --git a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TokenIcon/TokenIcon.scss b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TokenIcon/TokenIcon.scss index 7503240dbc1..343b3568c9d 100644 --- a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TokenIcon/TokenIcon.scss +++ b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TokenIcon/TokenIcon.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .TokenIcon { border-radius: 50%; diff --git a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AddressBalance/AddressBalance.scss b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AddressBalance/AddressBalance.scss index 28c9e13ce11..9892dd19ac0 100644 --- a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AddressBalance/AddressBalance.scss +++ b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AddressBalance/AddressBalance.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .AddressBalance { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AmountSelections/AmountSelections.scss b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AmountSelections/AmountSelections.scss index 86b886b242b..6bdb2cd5a3d 100644 --- a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AmountSelections/AmountSelections.scss +++ b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/AmountSelections/AmountSelections.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .AmountSelections { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/ReceiptDetails/ReceiptDetails.scss b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/ReceiptDetails/ReceiptDetails.scss index ceb2883efe1..dec9e66de56 100644 --- a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/ReceiptDetails/ReceiptDetails.scss +++ b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/ReceiptDetails/ReceiptDetails.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .ReceiptDetails { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/TradeTokenForm.scss b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/TradeTokenForm.scss index 37afad496ba..ea56ad1fe1d 100644 --- a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/TradeTokenForm.scss +++ b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenForm/TradeTokenForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .TradeTokenForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenModal.scss b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenModal.scss index 5eecf5b3918..6be98aba90c 100644 --- a/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/TradeTokenModel/TradeTokenModal.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .TradeTokenModal { overflow-y: scroll; diff --git a/packages/commonwealth/client/styles/pages/UpdateProposalStatusModal.scss b/packages/commonwealth/client/scripts/views/modals/UpdateProposalStatusModal.scss similarity index 100% rename from packages/commonwealth/client/styles/pages/UpdateProposalStatusModal.scss rename to packages/commonwealth/client/scripts/views/modals/UpdateProposalStatusModal.scss diff --git a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/WelcomeOnboardModal.scss b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/WelcomeOnboardModal.scss index dfd8fd376c4..c8af6208004 100644 --- a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/WelcomeOnboardModal.scss +++ b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/WelcomeOnboardModal.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared.scss'; +@import '../../../styles/shared.scss'; .WelcomeOnboardModal { overflow-y: scroll; diff --git a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityCard/JoinCommunityCard.scss b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityCard/JoinCommunityCard.scss index d10f115f3ef..31b0174b5b8 100644 --- a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityCard/JoinCommunityCard.scss +++ b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityCard/JoinCommunityCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared.scss'; +@import '../../../../../../styles/shared.scss'; .JoinCommunityCard { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityStep.scss b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityStep.scss index ea8348dabd7..ce3cbe1e324 100644 --- a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityStep.scss +++ b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/JoinCommunityStep/JoinCommunityStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .JoinCommunityStep { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PersonalInformationStep/PersonalInformationStep.scss b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PersonalInformationStep/PersonalInformationStep.scss index 6f442a9864a..6e5322616b8 100644 --- a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PersonalInformationStep/PersonalInformationStep.scss +++ b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PersonalInformationStep/PersonalInformationStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .PersonalInformationStep { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PreferencesStep/PreferencesStep.scss b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PreferencesStep/PreferencesStep.scss index ba9934c5d20..e35925aa279 100644 --- a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PreferencesStep/PreferencesStep.scss +++ b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/PreferencesStep/PreferencesStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .PreferencesStep { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/TermsOfServicesStep/TermsOfServicesStep.scss b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/TermsOfServicesStep/TermsOfServicesStep.scss index e8858ca4b2b..33bff8348ba 100644 --- a/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/TermsOfServicesStep/TermsOfServicesStep.scss +++ b/packages/commonwealth/client/scripts/views/modals/WelcomeOnboardModal/steps/TermsOfServicesStep/TermsOfServicesStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .TermsOfServicesStep { display: flex; diff --git a/packages/commonwealth/client/styles/modals/confirm_snapshot_vote_modal.scss b/packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.scss similarity index 91% rename from packages/commonwealth/client/styles/modals/confirm_snapshot_vote_modal.scss rename to packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.scss index 229b1a8fb5a..370f94a8a2b 100644 --- a/packages/commonwealth/client/styles/modals/confirm_snapshot_vote_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .ConfirmSnapshotVoteModal { .vote-info { diff --git a/packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.tsx b/packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.tsx index 5b386ab88b7..de421bf6619 100644 --- a/packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/confirm_snapshot_vote_modal.tsx @@ -6,7 +6,6 @@ import { BigNumber } from 'ethers'; import type { SnapshotProposal, SnapshotSpace } from 'helpers/snapshot_utils'; import { useBrowserAnalyticsTrack } from 'hooks/useBrowserAnalyticsTrack'; import useUserStore from 'state/ui/user'; -import '../../../styles/modals/confirm_snapshot_vote_modal.scss'; import { notifyError } from '../../controllers/app/notifications'; import { castVote } from '../../helpers/snapshot_utils'; import useAppStatus from '../../hooks/useAppStatus'; @@ -17,6 +16,7 @@ import { CWModalFooter, CWModalHeader, } from '../components/component_kit/new_designs/CWModal'; +import './confirm_snapshot_vote_modal.scss'; type ConfirmSnapshotVoteModalProps = { id: string; diff --git a/packages/commonwealth/client/styles/modals/confirmation_modal.scss b/packages/commonwealth/client/scripts/views/modals/confirmation_modal.scss similarity index 78% rename from packages/commonwealth/client/styles/modals/confirmation_modal.scss rename to packages/commonwealth/client/scripts/views/modals/confirmation_modal.scss index a252b5f7efd..d678830efa8 100644 --- a/packages/commonwealth/client/styles/modals/confirmation_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/confirmation_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .ConfirmationModal { display: flex; @@ -7,7 +7,8 @@ height: auto; min-height: inherit; border: 1px solid $neutral-200; - box-shadow: 0 12px 16px -4px rgba(40, 39, 41, 0.08), + box-shadow: + 0 12px 16px -4px rgba(40, 39, 41, 0.08), 0px 4px 6px -2px rgba(40, 39, 41, 0.03); border-radius: 6px; @@ -27,7 +28,9 @@ font-size: 14px; line-height: 20px; letter-spacing: 0.01em; - font-feature-settings: 'tnum' on, 'lnum' on; + font-feature-settings: + 'tnum' on, + 'lnum' on; color: $neutral-700; } diff --git a/packages/commonwealth/client/scripts/views/modals/confirmation_modal.tsx b/packages/commonwealth/client/scripts/views/modals/confirmation_modal.tsx index 0558f41cb2d..abcc22edf91 100644 --- a/packages/commonwealth/client/scripts/views/modals/confirmation_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/confirmation_modal.tsx @@ -14,7 +14,7 @@ import { CWModalHeader, } from '../components/component_kit/new_designs/CWModal'; -import '../../../styles/modals/confirmation_modal.scss'; +import './confirmation_modal.scss'; interface ConfirmationModalProps { title?: string; diff --git a/packages/commonwealth/client/styles/modals/delete_address_modal.scss b/packages/commonwealth/client/scripts/views/modals/delete_address_modal.scss similarity index 90% rename from packages/commonwealth/client/styles/modals/delete_address_modal.scss rename to packages/commonwealth/client/scripts/views/modals/delete_address_modal.scss index 453d83019e6..8ad3bd03a5d 100644 --- a/packages/commonwealth/client/styles/modals/delete_address_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/delete_address_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .DeleteAddressModal { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/modals/delete_address_modal.tsx b/packages/commonwealth/client/scripts/views/modals/delete_address_modal.tsx index 97e38da2973..0a85e4bbc51 100644 --- a/packages/commonwealth/client/scripts/views/modals/delete_address_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/delete_address_modal.tsx @@ -20,7 +20,7 @@ import { import { DEFAULT_NAME } from '@hicommonwealth/shared'; import axios from 'axios'; import useUserStore from 'state/ui/user'; -import '../../../styles/modals/delete_address_modal.scss'; +import './delete_address_modal.scss'; type DeleteAddressModalAttrs = { profile: NewProfile; diff --git a/packages/commonwealth/client/styles/modals/edit_collaborators_modal.scss b/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.scss similarity index 96% rename from packages/commonwealth/client/styles/modals/edit_collaborators_modal.scss rename to packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.scss index 9ffbc5c1fac..a796bf2b2d7 100644 --- a/packages/commonwealth/client/styles/modals/edit_collaborators_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .EditCollaboratorsModal { .section { diff --git a/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx b/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx index e5972435779..923915e3792 100644 --- a/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx @@ -24,7 +24,7 @@ import { User } from '../components/user/user'; import { buildUpdateThreadInput } from 'client/scripts/state/api/threads/editThread'; import useUserStore from 'state/ui/user'; -import '../../../styles/modals/edit_collaborators_modal.scss'; +import './edit_collaborators_modal.scss'; type EditCollaboratorsModalProps = { onModalClose: () => void; diff --git a/packages/commonwealth/client/styles/modals/edit_topic_modal.scss b/packages/commonwealth/client/scripts/views/modals/edit_topic_modal.scss similarity index 88% rename from packages/commonwealth/client/styles/modals/edit_topic_modal.scss rename to packages/commonwealth/client/scripts/views/modals/edit_topic_modal.scss index 1eaee5b9140..c90b4e7f562 100644 --- a/packages/commonwealth/client/styles/modals/edit_topic_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/edit_topic_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .EditTopicModal { .editor { @@ -36,4 +36,8 @@ margin-top: 0; } } + + .CWModalBody { + overflow: scroll; + } } diff --git a/packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx b/packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx index 82f19991a0e..ba3c3e8d0b7 100644 --- a/packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/edit_topic_modal.tsx @@ -18,13 +18,14 @@ import { } from '../components/component_kit/new_designs/CWModal'; import { openConfirmation } from './confirmation_modal'; +import clsx from 'clsx'; import { notifySuccess } from 'controllers/app/notifications'; import { DeltaStatic } from 'quill'; import { MessageRow } from 'views/components/component_kit/new_designs/CWTextInput/MessageRow'; -import '../../../styles/modals/edit_topic_modal.scss'; import { CWText } from '../components/component_kit/cw_text'; import { ReactQuillEditor } from '../components/react_quill_editor'; import { createDeltaFromText } from '../components/react_quill_editor/utils'; +import './edit_topic_modal.scss'; type EditTopicModalProps = { onModalClose: () => void; @@ -52,9 +53,20 @@ export const EditTopicModal = ({ const [description, setDescription] = useState( createDeltaFromText(descriptionProp), ); + const [newPostTemplate, setNewPostTemplate] = useState( + topic?.default_offchain_template + ? JSON.parse(decodeURIComponent(topic?.default_offchain_template)) + : '', + ); + const [newPostTemplateError, setNewPostTemplateError] = useState< + string | null + >(null); const [featuredInSidebar, setFeaturedInSidebar] = useState( featuredInSidebarProp, ); + const [featuredInNewPost, setFeaturedInNewPost] = useState( + topic?.featured_in_new_post || false, + ); const [name, setName] = useState(nameProp); const [characterCount, setCharacterCount] = useState(0); const [descErrorMsg, setDescErrorMsg] = useState(null); @@ -85,6 +97,17 @@ export const EditTopicModal = ({ } }, [description]); + useEffect(() => { + if ( + featuredInNewPost && + (newPostTemplate?.ops || [])?.[0]?.insert?.trim?.()?.length === 0 + ) { + setNewPostTemplateError('Topic template is required'); + } else { + setNewPostTemplateError(null); + } + }, [featuredInNewPost, newPostTemplate]); + const handleSaveChanges = async () => { setIsSaving(true); @@ -96,8 +119,11 @@ export const EditTopicModal = ({ community_id: app.activeChainId()!, telegram: null, featured_in_sidebar: featuredInSidebar, - featured_in_new_post: false, - default_offchain_template: '', + featured_in_new_post: featuredInNewPost, + default_offchain_template: + featuredInNewPost && newPostTemplate + ? JSON.stringify(newPostTemplate) + : '', }); if (noRedirect) { onModalClose(); @@ -211,6 +237,14 @@ export const EditTopicModal = ({ hasFeedback={!!descErrorMsg} validationStatus={descErrorMsg ? 'failure' : undefined} /> + + {featuredInNewPost && ( + + )}
+
+ + Featured topic in new post + + The topic template you add will be added as base text to every + new post within the topic. + +
+ } + checked={featuredInNewPost} + onChange={() => { + setFeaturedInNewPost(!featuredInNewPost); + }} + /> + {featuredInNewPost && ( + + )} +
@@ -246,7 +310,11 @@ export const EditTopicModal = ({ buttonHeight="sm" onClick={handleSaveChanges} label="Save changes" - disabled={!!topic.archived_at || !!descErrorMsg} + disabled={ + !!topic.archived_at || + !!descErrorMsg || + (featuredInNewPost && !!newPostTemplateError) + } />
{errorMsg && ( diff --git a/packages/commonwealth/client/styles/modals/new_snapshot_proposal_modal.scss b/packages/commonwealth/client/scripts/views/modals/new_snapshot_proposal_modal.scss similarity index 100% rename from packages/commonwealth/client/styles/modals/new_snapshot_proposal_modal.scss rename to packages/commonwealth/client/scripts/views/modals/new_snapshot_proposal_modal.scss diff --git a/packages/commonwealth/client/scripts/views/modals/new_snapshot_proposal_modal.tsx b/packages/commonwealth/client/scripts/views/modals/new_snapshot_proposal_modal.tsx index 63a56db69e8..6046e25215c 100644 --- a/packages/commonwealth/client/scripts/views/modals/new_snapshot_proposal_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/new_snapshot_proposal_modal.tsx @@ -10,7 +10,7 @@ import { CWModalHeader, } from '../components/component_kit/new_designs/CWModal'; -import '../../../styles/modals/new_snapshot_proposal_modal.scss'; +import './new_snapshot_proposal_modal.scss'; type NewSnapshotProposalModalProps = { thread: Thread; diff --git a/packages/commonwealth/client/styles/modals/offchain_voting_modal.scss b/packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.scss similarity index 93% rename from packages/commonwealth/client/styles/modals/offchain_voting_modal.scss rename to packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.scss index 1210bd08753..0c335d42ec2 100644 --- a/packages/commonwealth/client/styles/modals/offchain_voting_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .OffchainVotingModal { display: flex; diff --git a/packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.tsx b/packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.tsx index dffb7d86245..c57ab1f52f1 100644 --- a/packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/offchain_voting_modal.tsx @@ -7,7 +7,7 @@ import { } from '../components/component_kit/new_designs/CWModal'; import { User } from '../components/user/user'; -import '../../../styles/modals/offchain_voting_modal.scss'; +import './offchain_voting_modal.scss'; type OffchainVotingModalProps = { onModalClose: () => void; diff --git a/packages/commonwealth/client/styles/modals/poll_editor_modal.scss b/packages/commonwealth/client/scripts/views/modals/poll_editor_modal.scss similarity index 95% rename from packages/commonwealth/client/styles/modals/poll_editor_modal.scss rename to packages/commonwealth/client/scripts/views/modals/poll_editor_modal.scss index 78217e203df..3088ebbb82b 100644 --- a/packages/commonwealth/client/styles/modals/poll_editor_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/poll_editor_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .PollEditorModal { .options-and-label-container { diff --git a/packages/commonwealth/client/scripts/views/modals/poll_editor_modal.tsx b/packages/commonwealth/client/scripts/views/modals/poll_editor_modal.tsx index 10ed179b7f9..5c90dd80816 100644 --- a/packages/commonwealth/client/scripts/views/modals/poll_editor_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/poll_editor_modal.tsx @@ -20,7 +20,7 @@ import { CWModalHeader, } from '../components/component_kit/new_designs/CWModal'; -import '../../../styles/modals/poll_editor_modal.scss'; +import './poll_editor_modal.scss'; const getPollDurationCopy = ( customDuration: string, diff --git a/packages/commonwealth/client/scripts/views/modals/update_proposal_status_modal.tsx b/packages/commonwealth/client/scripts/views/modals/update_proposal_status_modal.tsx index ab0a7969e6d..279ebcab5e3 100644 --- a/packages/commonwealth/client/scripts/views/modals/update_proposal_status_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/update_proposal_status_modal.tsx @@ -25,7 +25,6 @@ import { MixpanelCommunityInteractionEvent, MixpanelCommunityInteractionEventPayload, } from '../../../../shared/analytics/types'; -import '../../../styles/pages/UpdateProposalStatusModal.scss'; import useAppStatus from '../../hooks/useAppStatus'; import { ThreadStage } from '../../models/types'; import { CosmosProposalSelector } from '../components/CosmosProposalSelector'; @@ -38,6 +37,7 @@ import { CWModalHeader, } from '../components/component_kit/new_designs/CWModal'; import { SnapshotProposalSelector } from '../components/snapshot_proposal_selector'; +import './UpdateProposalStatusModal.scss'; const getInitialSnapshots = (thread: Thread) => filterLinks(thread.links, LinkSource.Snapshot).map((l) => ({ diff --git a/packages/commonwealth/client/styles/modals/webhook_settings_modal.scss b/packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.scss similarity index 80% rename from packages/commonwealth/client/styles/modals/webhook_settings_modal.scss rename to packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.scss index 86a3f691ccc..07be6f21907 100644 --- a/packages/commonwealth/client/styles/modals/webhook_settings_modal.scss +++ b/packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .WebhookSettingsModal { .checkbox-section { diff --git a/packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.tsx b/packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.tsx index 89c8151ae55..a857a5c864b 100644 --- a/packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/webhook_settings_modal.tsx @@ -1,7 +1,6 @@ import { Webhook, WebhookSupportedEvents } from '@hicommonwealth/schemas'; import React, { useState } from 'react'; import z from 'zod'; -import '../../../styles/modals/webhook_settings_modal.scss'; import { CWCheckbox } from '../components/component_kit/cw_checkbox'; import { CWText } from '../components/component_kit/cw_text'; import { CWButton } from '../components/component_kit/new_designs/CWButton'; @@ -10,6 +9,7 @@ import { CWModalFooter, CWModalHeader, } from '../components/component_kit/new_designs/CWModal'; +import './webhook_settings_modal.scss'; type WebhookSettingsModalProps = { onModalClose: () => void; diff --git a/packages/commonwealth/client/styles/pages/AdminPanel.scss b/packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanel.scss similarity index 97% rename from packages/commonwealth/client/styles/pages/AdminPanel.scss rename to packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanel.scss index e1e514afef2..310c1727874 100644 --- a/packages/commonwealth/client/styles/pages/AdminPanel.scss +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanel.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../../styles/shared.scss'; .AdminPanel { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanelPage.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanelPage.tsx index 708a45704cc..d29ce1501ae 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanelPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/AdminPanelPage.tsx @@ -1,5 +1,4 @@ import { useCommonNavigate } from 'navigation/helpers'; -import 'pages/AdminPanel.scss'; import React, { useEffect } from 'react'; import Permissions from 'utils/Permissions'; import CWPageLayout from 'views/components/component_kit/new_designs/CWPageLayout'; @@ -7,6 +6,7 @@ import UpdateCommunityIdTask from 'views/pages/AdminPanel/UpdateCommunityIdTask' import UpdateCustomDomainTask from 'views/pages/AdminPanel/UpdateCustomDomainTask'; import { CWDivider } from '../../components/component_kit/cw_divider'; import { CWText } from '../../components/component_kit/cw_text'; +import './AdminPanel.scss'; import Analytics from './Analytics'; import ConnectChainToCommunity from './ConnectChainToCommunityTask'; import DeleteChainTask from './DeleteChainTask'; diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/Analytics.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/Analytics.tsx index a30e3523c5e..f30df9f0fa1 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/Analytics.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/Analytics.tsx @@ -1,12 +1,12 @@ import axios from 'axios'; import { notifyError } from 'controllers/app/notifications'; import useNecessaryEffect from 'hooks/useNecessaryEffect'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { SERVER_URL } from 'state/api/config'; import useUserStore from 'state/ui/user'; import { CWText } from '../../components/component_kit/cw_text'; import CWCircleMultiplySpinner from '../../components/component_kit/new_designs/CWCircleMultiplySpinner'; +import './AdminPanel.scss'; import CommunityFinder from './CommunityFinder'; type Stats = { diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/CommunityFinder.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/CommunityFinder.tsx index d472805f0db..43632b936ed 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/CommunityFinder.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/CommunityFinder.tsx @@ -1,9 +1,9 @@ -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { useGetCommunityByIdQuery } from 'state/api/communities'; import { useDebounce } from 'usehooks-ts'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { CWTextInput } from '../../components/component_kit/new_designs/CWTextInput'; +import './AdminPanel.scss'; type CommunityFinderProps = { ctaLabel: string; diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/ConnectChainToCommunityTask.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/ConnectChainToCommunityTask.tsx index 1bdb2b2f50e..4065ca05af0 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/ConnectChainToCommunityTask.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/ConnectChainToCommunityTask.tsx @@ -1,7 +1,6 @@ import { ChainType } from '@hicommonwealth/shared'; import { buildUpdateCommunityInput } from 'client/scripts/state/api/communities/updateCommunity'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { useGetCommunityByIdQuery, @@ -17,6 +16,7 @@ import { CWText } from '../../components/component_kit/cw_text'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { CWTextInput } from '../../components/component_kit/new_designs/CWTextInput'; import { openConfirmation } from '../../modals/confirmation_modal'; +import './AdminPanel.scss'; import { getSortedChains } from './utils'; const ConnectChainToCommunityTask = () => { diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/DeleteChainTask.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/DeleteChainTask.tsx index 18db6e513e3..a770f3aeb53 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/DeleteChainTask.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/DeleteChainTask.tsx @@ -1,9 +1,9 @@ import { trpc } from 'client/scripts/utils/trpcClient'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { CWText } from '../../components/component_kit/cw_text'; import { openConfirmation } from '../../modals/confirmation_modal'; +import './AdminPanel.scss'; import CommunityFinder from './CommunityFinder'; const DeleteCommunityTask = () => { diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/DownloadMembersListTask.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/DownloadMembersListTask.tsx index 60ef9cd1e62..bda40527a06 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/DownloadMembersListTask.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/DownloadMembersListTask.tsx @@ -1,8 +1,8 @@ import { notifyError, notifySuccess } from 'controllers/app/notifications'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { CWText } from '../../components/component_kit/cw_text'; import { openConfirmation } from '../../modals/confirmation_modal'; +import './AdminPanel.scss'; import CommunityFinder from './CommunityFinder'; import { downloadCSV, getCSVContent } from './utils'; diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/MakeSiteAdminTask.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/MakeSiteAdminTask.tsx index f425fd51818..dc8f725be0d 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/MakeSiteAdminTask.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/MakeSiteAdminTask.tsx @@ -1,5 +1,4 @@ import { notifyError, notifySuccess } from 'controllers/app/notifications'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { isAddress } from 'web3-utils'; import { CWText } from '../../components/component_kit/cw_text'; @@ -7,6 +6,7 @@ import { CWTextInput } from '../../components/component_kit/cw_text_input'; import { ValidationStatus } from '../../components/component_kit/cw_validation_text'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { openConfirmation } from '../../modals/confirmation_modal'; +import './AdminPanel.scss'; import { updateSiteAdmin } from './utils'; const MakeSiteAdminTask = () => { @@ -21,7 +21,9 @@ const MakeSiteAdminTask = () => { const onPromote = () => { openConfirmation({ title: 'Promote to Site Admin', - description: `Are you sure you want promote ${address} to super admin? The apotheosis of a user is not to be taken lightly.`, + description: ` + Are you sure you want promote ${address} to super admin? The apotheosis of a user is not to be taken lightly. + `, buttons: [ { label: 'promote', diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/RPCEndpointTask.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/RPCEndpointTask.tsx index 732013485f7..85513edad7f 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/RPCEndpointTask.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/RPCEndpointTask.tsx @@ -2,7 +2,6 @@ import { BalanceType } from '@hicommonwealth/shared'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; import { detectURL } from 'helpers/threads'; import NodeInfo from 'models/NodeInfo'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { getNodeByUrl } from 'state/api/nodes/utils'; import useFetchNodesQuery from '../../../state/api/nodes/fetchNodes'; @@ -16,6 +15,7 @@ import { import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { CWTextInput } from '../../components/component_kit/new_designs/CWTextInput'; import { openConfirmation } from '../../modals/confirmation_modal'; +import './AdminPanel.scss'; import { createChainNode } from './utils'; const RPCEndpointTask = () => { diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/TopUsers.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/TopUsers.tsx index f7d9f88c17e..fcce5cce348 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/TopUsers.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/TopUsers.tsx @@ -1,7 +1,7 @@ -import 'pages/AdminPanel.scss'; import React from 'react'; import { CWText } from '../../components/component_kit/cw_text'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; +import './AdminPanel.scss'; import { downloadCSV as downloadAsCSV, getTopUsersList } from './utils'; const TopUsers = () => { diff --git a/packages/commonwealth/client/scripts/views/pages/AdminPanel/TriggerNotificationsWorkflow.tsx b/packages/commonwealth/client/scripts/views/pages/AdminPanel/TriggerNotificationsWorkflow.tsx index c95a92ded40..a0f2cc1c2c0 100644 --- a/packages/commonwealth/client/scripts/views/pages/AdminPanel/TriggerNotificationsWorkflow.tsx +++ b/packages/commonwealth/client/scripts/views/pages/AdminPanel/TriggerNotificationsWorkflow.tsx @@ -1,5 +1,4 @@ import { notifyError, notifySuccess } from 'controllers/app/notifications'; -import 'pages/AdminPanel.scss'; import React, { useState } from 'react'; import { useTriggerNotificationsWorkflowMutation } from 'state/api/superAdmin'; import { openConfirmation } from 'views/modals/confirmation_modal'; @@ -7,6 +6,7 @@ import { CWText } from '../../components/component_kit/cw_text'; import { CWTextInput } from '../../components/component_kit/cw_text_input'; import { ValidationStatus } from '../../components/component_kit/cw_validation_text'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; +import './AdminPanel.scss'; const TriggerNotificationsWorkflow = () => { const [workflowKey, setWorkflowKey] = useState(''); diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/Communities.scss b/packages/commonwealth/client/scripts/views/pages/Communities/Communities.scss index c8a5128cd5f..d42062853fb 100644 --- a/packages/commonwealth/client/scripts/views/pages/Communities/Communities.scss +++ b/packages/commonwealth/client/scripts/views/pages/Communities/Communities.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .BreadcrumbsComponent { z-index: 0 !important; @@ -11,6 +11,7 @@ .layout-container { height: 100%; + margin-top: 10px; } } @@ -18,11 +19,11 @@ display: flex; flex: 1; flex-direction: column; + overflow: hidden; .header-section { display: flex; flex-direction: column; - gap: 16px; position: sticky; top: 0; diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/Communities.tsx b/packages/commonwealth/client/scripts/views/pages/Communities/Communities.tsx index 29a449e9950..3dc0fc0d0ee 100644 --- a/packages/commonwealth/client/scripts/views/pages/Communities/Communities.tsx +++ b/packages/commonwealth/client/scripts/views/pages/Communities/Communities.tsx @@ -25,6 +25,7 @@ import { CWTag } from '../../components/component_kit/new_designs/CWTag'; import CreateCommunityButton from '../../components/sidebar/CreateCommunityButton'; import ManageCommunityStakeModal from '../../modals/ManageCommunityStakeModal/ManageCommunityStakeModal'; import './Communities.scss'; +import ExploreContestList from './ExploreContestList'; import { CommunityFilters, CommunitySortDirections, @@ -322,6 +323,7 @@ const CommunitiesPage = () => { + {tokenizedCommunityEnabled && Communities} {isLoading && communitiesList.length === 0 ? ( diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/ExploreContestCard.scss b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/ExploreContestCard.scss new file mode 100644 index 00000000000..511dde1f3da --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/ExploreContestCard.scss @@ -0,0 +1,99 @@ +@import '../../../../../styles/shared'; + +.ExploreContestCard { + border-radius: 6px; + padding: 16px; + border: 1px solid $neutral-100; + background: $white; + display: flex; + flex-direction: column; + + &:hover { + box-shadow: $elevation-2; + } + + .contest-banner { + border-radius: 6px; + height: 160px; + + .banner-image { + border-radius: 6px; + width: 100%; + height: 100%; + object-fit: cover; + } + } + + .contest-content { + padding-block: 4px; + flex: 1; + display: flex; + flex-direction: column; + + .contest-header { + display: flex; + align-items: center; + + gap: 8px; + margin-bottom: 8px; + position: relative; + + .contest-title { + @include multiline-text-ellipsis(1); + } + + .contest-icon-container { + position: absolute; + background: $white; + border-radius: 50%; + right: 8px; + top: -20px; + width: 30px; + height: 30px; + + .contest-icon { + width: 100%; + height: 100%; + + &.common-icon { + padding: 2px; + } + } + } + } + + .contest-timing { + margin-bottom: 16px; + } + + .prizes-section { + margin-bottom: 16px; + + .prize-list { + margin-top: 8px; + + .prize-row { + display: flex; + justify-content: space-between; + + .label { + color: $neutral-600; + } + } + } + } + + .contest-actions { + display: flex; + gap: 16px; + margin-bottom: 16px; + } + + .cta-button-container { + display: flex; + align-items: center; + height: 40px; + margin-top: auto; + } + } +} diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/ExploreContestCard.tsx b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/ExploreContestCard.tsx new file mode 100644 index 00000000000..0f7d05058c8 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/ExploreContestCard.tsx @@ -0,0 +1,180 @@ +import clsx from 'clsx'; +import moment from 'moment'; +import React from 'react'; + +import commonLogo from 'assets/img/branding/common.svg'; +import farcasterUrl from 'assets/img/farcaster.svg'; +import { navigateToCommunity, useCommonNavigate } from 'navigation/helpers'; +import { useGetContestBalanceQuery } from 'state/api/contests'; +import { Skeleton } from 'views/components/Skeleton'; +import { CWCommunityAvatar } from 'views/components/component_kit/cw_community_avatar'; +import { capDecimals } from 'views/modals/ManageCommunityStakeModal/utils'; + +import { CWText } from '../../../../components/component_kit/cw_text'; +import { CWButton } from '../../../../components/component_kit/new_designs/CWButton/CWButton'; +import { CWThreadAction } from '../../../../components/component_kit/new_designs/cw_thread_action'; +import { Contest } from '../../../CommunityManagement/Contests/ContestsList'; +import ContestCountdown from '../../../CommunityManagement/Contests/ContestsList/ContestCountdown'; + +import './ExploreContestCard.scss'; + +interface ExploreContestCardProps { + contest: Contest; + community: { + name: string; + iconUrl: string; + chainNodeUrl: string; + ethChainId: number; + }; +} + +const ExploreContestCard = ({ + contest, + community, +}: ExploreContestCardProps) => { + const navigate = useCommonNavigate(); + const finishDate = moment(contest.contests?.[0].end_time).toISOString(); + + const { data: contestBalance, isLoading: isContestBalanceLoading } = + useGetContestBalanceQuery({ + contestAddress: contest.contest_address || '', + chainRpc: community.chainNodeUrl, + ethChainId: community.ethChainId, + isOneOff: !!contest.funding_token_address, + apiEnabled: Boolean( + contest.contest_address && + community.chainNodeUrl && + community.ethChainId, + ), + }); + + const prizes = + contestBalance && contest.payout_structure + ? contest.payout_structure.map( + (percentage) => + (contestBalance * (percentage / 100)) / + Math.pow(10, contest.decimals || 18), + ) + : []; + + const handleGoToContest = () => { + const path = contest.is_farcaster_contest + ? `/contests/${contest.contest_address}` + : `/discussions/${contest.topics?.[0]?.name}`; + + navigateToCommunity({ + navigate, + path, + chain: contest.community_id || '', + }); + }; + + const handleLeaderboardClick = () => { + const path = contest.is_farcaster_contest + ? `/contests/${contest.contest_address}` + : `/discussions?featured=mostLikes&contest=${contest.contest_address}`; + + navigateToCommunity({ + navigate, + path, + chain: contest.community_id || '', + }); + }; + + return ( +
+
+ Contest banner +
+ +
+
+ { + navigateToCommunity({ + navigate, + path: '', + chain: contest.community_id || '', + }); + }} + community={{ + name: community.name, + iconUrl: community.iconUrl, + }} + /> + + + {contest.name} +
+ +
+
+
+ +
+ +
+ +
+ + Current Prizes + +
+ {isContestBalanceLoading ? ( + <> + + + + + ) : prizes.length > 0 ? ( + prizes?.map((prize, index) => ( +
+ + {moment.localeData().ordinal(index + 1)} Prize + + + {capDecimals(String(prize))} {contest.ticker} + +
+ )) + ) : ( + No prizes available + )} +
+
+ +
+ +
+ +
+ +
+
+
+ ); +}; + +export default ExploreContestCard; diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/index.ts b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/index.ts new file mode 100644 index 00000000000..1c79d76fe1c --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestCard/index.ts @@ -0,0 +1,3 @@ +import ExploreContestCard from './ExploreContestCard'; + +export default ExploreContestCard; diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestList.scss b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestList.scss new file mode 100644 index 00000000000..d5719ade4a1 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestList.scss @@ -0,0 +1,24 @@ +@import '../../../../styles/shared'; + +.ExploreContestList { + margin: 16px 0; + + .content { + display: grid; + grid-gap: 28px; + grid-template-columns: 1fr 1fr; + justify-content: center; + margin: 24px 0; + + @include extraSmall { + grid-template-columns: 1fr; + } + } + + .empty-contests { + margin: 24px auto; + display: flex; + justify-content: center; + text-align: center; + } +} diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestList.tsx b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestList.tsx new file mode 100644 index 00000000000..e905d5cda21 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/ExploreContestList.tsx @@ -0,0 +1,73 @@ +import React from 'react'; +import { trpc } from 'utils/trpcClient'; +import { Skeleton } from 'views/components/Skeleton'; +import { CWText } from 'views/components/component_kit/cw_text'; +import useCommunityContests from '../../CommunityManagement/Contests/useCommunityContests'; +import ExploreContestCard from './ExploreContestCard'; + +import './ExploreContestList.scss'; + +const ExploreContestList = () => { + const { + contestsData: { active: activeContests }, + isContestDataLoading, + } = useCommunityContests({ + fetchAll: true, + }); + + const communityIds = [ + ...new Set(activeContests.map((contest) => contest.community_id)), + ]; + + const communityQueries = trpc.useQueries((t) => + communityIds.map((id) => + t.community.getCommunity({ id: id!, include_node_info: true }), + ), + ); + + const community = communityIds.reduce((acc, id, index) => { + const communityData = communityQueries[index].data; + return { + ...acc, + [id as string]: { + name: communityData?.name || '', + iconUrl: communityData?.icon_url || '', + chainNodeUrl: communityData?.ChainNode?.url, + ethChainId: communityData?.ChainNode?.eth_chain_id, + }, + }; + }, {}); + + return ( +
+ Contests + <> + {!isContestDataLoading && activeContests.length === 0 && ( + + No active contests found + + )} + {isContestDataLoading ? ( +
+ <> + + + +
+ ) : ( +
+ {activeContests.map((contest) => ( + + ))} +
+ )} + +
+ ); +}; + +export default ExploreContestList; diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/index.ts b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/index.ts new file mode 100644 index 00000000000..0e52339e607 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/Communities/ExploreContestList/index.ts @@ -0,0 +1 @@ +export { default } from './ExploreContestList'; diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/FiltersDrawer/FiltersDrawer.scss b/packages/commonwealth/client/scripts/views/pages/Communities/FiltersDrawer/FiltersDrawer.scss index ac2fec25514..c69e8b0ae9e 100644 --- a/packages/commonwealth/client/scripts/views/pages/Communities/FiltersDrawer/FiltersDrawer.scss +++ b/packages/commonwealth/client/scripts/views/pages/Communities/FiltersDrawer/FiltersDrawer.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared.scss'; +@import '../../../../styles/shared.scss'; .FiltersDrawer { .Drawer.filter-drawer { diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/QuickTokenLaunchForm/QuickTokenLaunchForm.scss b/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/QuickTokenLaunchForm/QuickTokenLaunchForm.scss index 03f075148da..e5d35c534d7 100644 --- a/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/QuickTokenLaunchForm/QuickTokenLaunchForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/QuickTokenLaunchForm/QuickTokenLaunchForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .QuickTokenLaunchForm { div.h3 { diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/TokenLaunchDrawer/TokenLaunchDrawer.scss b/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/TokenLaunchDrawer/TokenLaunchDrawer.scss index 01566b39a7a..ce9689d27f3 100644 --- a/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/TokenLaunchDrawer/TokenLaunchDrawer.scss +++ b/packages/commonwealth/client/scripts/views/pages/Communities/IdeaLaunchpad/TokenLaunchDrawer/TokenLaunchDrawer.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared.scss'; +@import '../../../../../styles/shared.scss'; .TokenLaunchDrawer { .Drawer.filter-drawer { diff --git a/packages/commonwealth/client/scripts/views/pages/Communities/TokensList/TokensList.scss b/packages/commonwealth/client/scripts/views/pages/Communities/TokensList/TokensList.scss index 811c1348ed1..a85cfbc18c6 100644 --- a/packages/commonwealth/client/scripts/views/pages/Communities/TokensList/TokensList.scss +++ b/packages/commonwealth/client/scripts/views/pages/Communities/TokensList/TokensList.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .TokensList { margin: 16px 0; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Create/CreateCommunityGroupPage.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Create/CreateCommunityGroupPage.scss index 155a9b90cbe..d272ed628c8 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Create/CreateCommunityGroupPage.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Create/CreateCommunityGroupPage.scss @@ -1 +1 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/DeleteGroupModal/DeleteGroupModal.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/DeleteGroupModal/DeleteGroupModal.scss index 5608366c107..6173fe51b8d 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/DeleteGroupModal/DeleteGroupModal.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/DeleteGroupModal/DeleteGroupModal.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .DeleteGroupModal { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/TopicGatingHelpMessage/TopicGatingHelpMessage.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/TopicGatingHelpMessage/TopicGatingHelpMessage.scss index 12760b3766e..fc6fb1dac6d 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/TopicGatingHelpMessage/TopicGatingHelpMessage.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/TopicGatingHelpMessage/TopicGatingHelpMessage.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .TopicGatingHelpMessage { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Update/UpdateCommunityGroupPage.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Update/UpdateCommunityGroupPage.scss index 155a9b90cbe..d272ed628c8 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Update/UpdateCommunityGroupPage.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/Update/UpdateCommunityGroupPage.scss @@ -1 +1 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/Allowlist/Allowlist.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/Allowlist/Allowlist.scss index 0e06e171c61..d2a94878bf1 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/Allowlist/Allowlist.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/Allowlist/Allowlist.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .Allowlist { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/GroupForm.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/GroupForm.scss index 94dd4e13a16..ae40eacbbb4 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/GroupForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/GroupForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .GroupForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/RequirementSubForm/RequirementSubForm.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/RequirementSubForm/RequirementSubForm.scss index 30e3da954fd..ea5c005d084 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/RequirementSubForm/RequirementSubForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/RequirementSubForm/RequirementSubForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .RequirementSubForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/TopicPermissionsSubForm/TopicPermissionsSubForm.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/TopicPermissionsSubForm/TopicPermissionsSubForm.scss index 613c16c049e..15d4633a4e1 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/TopicPermissionsSubForm/TopicPermissionsSubForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Groups/common/GroupForm/TopicPermissionsSubForm/TopicPermissionsSubForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .TopicPermissionsSubForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.scss index 3503b8c533a..1017b695319 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .CommunityMembersPage { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.tsx index 4521f84b51e..dafbe3aa9ea 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/CommunityMembersPage.tsx @@ -1,4 +1,5 @@ import { DEFAULT_NAME } from '@hicommonwealth/shared'; +import { OpenFeature } from '@openfeature/web-sdk'; import { APIOrderDirection } from 'helpers/constants'; import { useBrowserAnalyticsTrack } from 'hooks/useBrowserAnalyticsTrack'; import useTopicGating from 'hooks/useTopicGating'; @@ -36,6 +37,7 @@ import { CWTextInput } from 'views/components/component_kit/new_designs/CWTextIn import useAppStatus from '../../../../hooks/useAppStatus'; import './CommunityMembersPage.scss'; import GroupsSection from './GroupsSection'; +import LeaderboardSection from './LeaderboardSection'; import MembersSection from './MembersSection'; import { Member } from './MembersSection/MembersSection'; import { @@ -44,9 +46,21 @@ import { SearchFilters, } from './index.types'; +const client = OpenFeature.getClient(); +const referralsEnabled = client.getBooleanValue('referrals', false); + +enum TabValues { + AllMembers = 'all-members', + Leaderboard = 'leaderboard', + Groups = 'groups', +} + const TABS = [ - { value: 'all-members', label: 'All members' }, - { value: 'groups', label: 'Groups' }, + { value: TabValues.AllMembers, label: 'All members' }, + ...(referralsEnabled + ? [{ value: TabValues.Leaderboard, label: 'Leaderboard' }] + : []), + { value: TabValues.Groups, label: 'Groups' }, ]; const GROUP_AND_MEMBER_FILTERS: { label: string; value: BaseGroupFilter }[] = [ @@ -59,7 +73,9 @@ const CommunityMembersPage = () => { const navigate = useCommonNavigate(); const user = useUserStore(); - const [selectedTab, setSelectedTab] = useState(TABS[0].value); + const [selectedTab, setSelectedTab] = useState( + TabValues.AllMembers, + ); const [searchFilters, setSearchFilters] = useState({ searchText: '', groupFilter: GROUP_AND_MEMBER_FILTERS[0].value, @@ -270,16 +286,18 @@ const CommunityMembersPage = () => { const totalResults = members?.pages?.[0]?.totalResults || 0; - const updateActiveTab = (activeTab: string) => { + const updateActiveTab = (activeTab: TabValues) => { const params = new URLSearchParams(); params.set('tab', activeTab); navigate(`${window.location.pathname}?${params.toString()}`, {}, null); setSelectedTab(activeTab); let eventType; - if (activeTab === TABS[0].value) { + if (activeTab === TabValues.AllMembers) { eventType = MixpanelPageViewEvent.MEMBERS_PAGE_VIEW; - } else { + } else if (activeTab === TabValues.Leaderboard) { + eventType = MixpanelPageViewEvent.LEADERBOARD_PAGE_VIEW; + } else if (activeTab === TabValues.Groups) { eventType = MixpanelPageViewEvent.GROUPS_PAGE_VIEW; } @@ -298,14 +316,12 @@ const CommunityMembersPage = () => { useEffect(() => { // Set the active tab based on URL const params = new URLSearchParams(window.location.search.toLowerCase()); - const activeTab = params.get('tab')?.toLowerCase(); + const activeTab = + TABS.find((t) => t.value === params.get('tab')?.toLowerCase())?.value || + TabValues.AllMembers; - if (!activeTab || activeTab === TABS[0].value) { - updateActiveTab(TABS[0].value); - return; - } + updateActiveTab(activeTab); - updateActiveTab(TABS[1].value); // eslint-disable-next-line react-hooks/exhaustive-deps }, [location.search]); @@ -348,7 +364,7 @@ const CommunityMembersPage = () => { {/* Gating group post-mutation banner */} {shouldShowGroupMutationBannerForCommunities.includes(communityId) && - selectedTab === TABS[0].value && ( + selectedTab === TabValues.AllMembers && (
{ )} {/* Filter section */} - {selectedTab === TABS[1].value && groups?.length === 0 ? ( + {selectedTab === TabValues.Leaderboard && groups?.length === 0 ? ( <> ) : (
{ size="large" fullWidth placeholder={`Search ${ - selectedTab === TABS[0].value ? 'members' : 'groups' + selectedTab === TabValues.AllMembers ? 'members' : 'groups' }`} containerClassName="search-input-container" inputClassName="search-input" @@ -435,12 +451,14 @@ const CommunityMembersPage = () => { )} {/* Main content section: based on the selected tab */} - {selectedTab === TABS[1].value ? ( + {selectedTab === TabValues.Groups ? ( + ) : selectedTab === TabValues.Leaderboard ? ( + ) : ( diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/GroupCard.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/GroupCard.scss index aaa2dce4216..ab8990633fc 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/GroupCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/GroupCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .GroupCard { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/InfoBlock.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/InfoBlock.scss index cad849b623e..f06c9efd1b1 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/InfoBlock.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/InfoBlock.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .InfoBlock { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/RequirementCard.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/RequirementCard.scss index 51cb89651d3..72159fd035d 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/RequirementCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupCard/RequirementCard/RequirementCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .RequirementCard { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupsSection.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupsSection.scss index cdef7875d8e..b01ddf8a0fb 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupsSection.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/GroupsSection/GroupsSection.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .GroupsSection { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/LeaderboardSection.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/LeaderboardSection.scss new file mode 100644 index 00000000000..dfa2636f437 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/LeaderboardSection.scss @@ -0,0 +1,29 @@ +@import '../../../../../styles/shared'; + +.LeaderboardSection { + display: flex; + flex-direction: column; + gap: 24px; + + .search-input-container { + margin-block: 4px; + .text-input-left-icon { + position: absolute; + } + } + + .search-input { + padding-left: 48px !important; + } + + .search-icon { + position: relative; + left: 16px !important; + color: $neutral-400; + } + + table { + width: 100%; + @include table-cell; + } +} diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/LeaderboardSection.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/LeaderboardSection.tsx new file mode 100644 index 00000000000..16f628807e3 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/LeaderboardSection.tsx @@ -0,0 +1,178 @@ +import React, { useState } from 'react'; +import { Link } from 'react-router-dom'; + +import { APIOrderDirection } from 'helpers/constants'; +import { Avatar } from 'views/components/Avatar'; +import { CWIcon } from 'views/components/component_kit/cw_icons/cw_icon'; +import { CWTable } from 'views/components/component_kit/new_designs/CWTable'; +import { CWTableColumnInfo } from 'views/components/component_kit/new_designs/CWTable/CWTable'; +import { useCWTableState } from 'views/components/component_kit/new_designs/CWTable/useCWTableState'; +import { CWTextInput } from 'views/components/component_kit/new_designs/CWTextInput'; + +import './LeaderboardSection.scss'; + +const fakeData = [ + { + rank: 1, + user: { + name: 'cambell', + avatarUrl: + 'https://assets.commonwealth.im/794bb7a3-17d7-407a-b52e-2987501221b5.png', + userId: '128606', + address: 'address1', + }, + referrals: 30, + earnings: '0.0003', + referredBy: { + name: 'adam', + avatarUrl: + 'https://assets.commonwealth.im/0847e7f5-4d96-4406-8f30-c3082fa2f27c.png', + userId: '135099', + address: 'address2', + }, + }, + { + rank: 2, + user: { + name: 'adam', + avatarUrl: + 'https://assets.commonwealth.im/0847e7f5-4d96-4406-8f30-c3082fa2f27c.png', + userId: '135099', + address: 'address2', + }, + referrals: 20, + earnings: '0.0002', + referredBy: { + name: 'cambell', + avatarUrl: + 'https://assets.commonwealth.im/794bb7a3-17d7-407a-b52e-2987501221b5.png', + userId: '128606', + address: 'address1', + }, + }, + { + rank: 3, + user: { + name: 'mike', + avatarUrl: + 'https://assets.commonwealth.im/181e25ad-ce08-427d-8d3a-d290af3be44b.png', + userId: '158139', + address: 'address3', + }, + referrals: 10, + earnings: '0.0001', + referredBy: {}, + }, +]; + +const columns: CWTableColumnInfo[] = [ + { + key: 'rank', + header: 'Rank', + numeric: true, + sortable: true, + }, + { + key: 'member', + header: 'Member', + numeric: false, + sortable: true, + }, + { + key: 'referrals', + header: 'Referrals', + numeric: true, + sortable: true, + }, + { + key: 'earnings', + header: 'Earnings', + numeric: false, + sortable: true, + }, + { + key: 'referredBy', + header: 'Referred By', + numeric: false, + sortable: false, + }, +]; + +const LeaderboardSection = () => { + const [searchText, setSearchText] = useState(''); + + const tableState = useCWTableState({ + columns, + initialSortColumn: 'rank', + initialSortDirection: APIOrderDirection.Asc, + }); + + const filteredData = fakeData.filter((item) => + item.user.name.toLowerCase().includes(searchText.toLowerCase()), + ); + + return ( +
+ } + onInput={(e) => setSearchText(e.target.value?.trim())} + /> + ({ + ...item, + member: { + sortValue: item.user.name.toLowerCase(), + customElement: ( +
+ + +

{item.user.name}

+ +
+ ), + }, + earnings: { + sortValue: item.earnings, + customElement: ( +
ETH {item.earnings}
+ ), + }, + referredBy: { + customElement: ( +
+ + +

{item?.referredBy?.name}

+ +
+ ), + }, + }))} + /> +
+ ); +}; + +export default LeaderboardSection; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/index.ts b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/index.ts new file mode 100644 index 00000000000..cff44855126 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/LeaderboardSection/index.ts @@ -0,0 +1,3 @@ +import LeaderboardSection from './LeaderboardSection'; + +export default LeaderboardSection; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/MembersSection/MembersSection.scss b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/MembersSection/MembersSection.scss index 255dce7e855..cba053373cf 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/MembersSection/MembersSection.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityGroupsAndMembers/Members/MembersSection/MembersSection.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .MembersSection { display: flex; @@ -10,37 +10,6 @@ table { width: 100%; - - .table-cell { - display: flex; - gap: 8px; - align-items: center; - flex-wrap: wrap; - - .user-info { - text-decoration: none; - display: flex; - align-items: center; - gap: 8px; - color: black; - - div { - display: flex; - justify-content: center; - align-items: center; - } - - :hover, - :focus, - :visited { - text-decoration: underline; - } - } - - &.text-right { - display: block; - text-align: right; - } - } + @include table-cell; } } diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/ManageRoles/ManageRoles.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/ManageRoles/ManageRoles.scss index 3e37c6bf2bc..9601cb36500 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/ManageRoles/ManageRoles.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/ManageRoles/ManageRoles.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ManageRoles { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/UpgradeRolesForm/UpgradeRolesForm.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/UpgradeRolesForm/UpgradeRolesForm.scss index c626cee3215..62e4da6f3ea 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/UpgradeRolesForm/UpgradeRolesForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/AdminsAndModerators/UpgradeRolesForm/UpgradeRolesForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; @mixin sharedIconStyles { position: absolute; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/CommunityProfile/CommunityProfileForm/CommunityProfileForm.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/CommunityProfile/CommunityProfileForm/CommunityProfileForm.scss index 40332286f1d..c7d2fcb3a35 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/CommunityProfile/CommunityProfileForm/CommunityProfileForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/CommunityProfile/CommunityProfileForm/CommunityProfileForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CommunityProfileForm { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/AdminContestsPage.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/AdminContestsPage.scss index 5096d285209..45fac473417 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/AdminContestsPage.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/AdminContestsPage.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .AdminContestsPage { .admin-header-row { diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/FeeManagerBanner/FeeManagerBanner.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/FeeManagerBanner/FeeManagerBanner.scss index 8f60a7ded0d..fc1c5d249c0 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/FeeManagerBanner/FeeManagerBanner.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/AdminContestsPage/FeeManagerBanner/FeeManagerBanner.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .FeeManagerBannerSkeleton { max-width: 600px; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestAlert/ContestAlert.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestAlert/ContestAlert.scss index 48d9d0b9af3..744aa7b9f57 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestAlert/ContestAlert.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestAlert/ContestAlert.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .ContestAlert { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCard/ContestCard.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCard/ContestCard.scss index 22081f25d62..ada0d5eaa83 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCard/ContestCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCard/ContestCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .ContestCard { max-width: 600px; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCountdown/ContestCountdown.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCountdown/ContestCountdown.scss index add743b736d..d84f95073fe 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCountdown/ContestCountdown.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestCountdown/ContestCountdown.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .ContestCountdown { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestsList.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestsList.scss index c82d86097fc..fa709f2990d 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestsList.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ContestsList/ContestsList.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ContestsListSkeleton { max-width: 600px; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/CopyAddressInput/CopyAddressInput.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/CopyAddressInput/CopyAddressInput.scss index 1cb675fffed..d0124e6148f 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/CopyAddressInput/CopyAddressInput.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/CopyAddressInput/CopyAddressInput.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CopyAddressInput { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/EmptyContestsList/EmptyCard/EmptyCard.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/EmptyContestsList/EmptyCard/EmptyCard.scss index 8c3340f4250..a6a7175b9f7 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/EmptyContestsList/EmptyCard/EmptyCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/EmptyContestsList/EmptyCard/EmptyCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .EmptyCard { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/FundContestDrawer.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/FundContestDrawer.scss index 9ffe3b4439c..f94c2511efc 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/FundContestDrawer.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/FundContestDrawer.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .FundContestDrawer { .Drawer { diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestFailure/FundContestFailure.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestFailure/FundContestFailure.scss index a0b4b11cc2c..7076647c54a 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestFailure/FundContestFailure.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestFailure/FundContestFailure.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .FundContestFailure { text-align: center; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestForm/FundContestForm.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestForm/FundContestForm.scss index 96c6747d3f4..baee44d354d 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestForm/FundContestForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestForm/FundContestForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .FundContestForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestLoading/FundContestLoading.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestLoading/FundContestLoading.scss index b98a2fdba57..d9fdaa909b9 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestLoading/FundContestLoading.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestLoading/FundContestLoading.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .FundContestLoading { height: calc(100% - 52px); diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestSuccess/FundContestSuccess.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestSuccess/FundContestSuccess.scss index 42810d9ee36..c77c7ce21ea 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestSuccess/FundContestSuccess.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/FundContestDrawer/steps/FundContestSuccess/FundContestSuccess.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .FundContestSuccess { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/ContestLiveStep/ContestLiveStep.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/ContestLiveStep/ContestLiveStep.scss index 6e187b2c719..6b88b0382fd 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/ContestLiveStep/ContestLiveStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/ContestLiveStep/ContestLiveStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .ContestLiveStep { margin-inline: auto; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.scss index 6f17cd9f190..4289d8e611c 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/DetailsFormStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .CommunityManagementLayout { .contest-description, diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/utils.ts b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/utils.ts index 67b3fe6f5e8..d7c46247068 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/utils.ts +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/DetailsFormStep/utils.ts @@ -1,4 +1,4 @@ -import colors from '../../../../../../../../styles/mixins/colors.module.scss'; +import colors from '../../../../../../../styles/mixins/colors.module.scss'; export const INITIAL_PERCENTAGE_VALUE = 10; export const MAX_WINNERS = 10; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/SignTransactionsStep/SignTransactionsStep.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/SignTransactionsStep/SignTransactionsStep.scss index ba94c018fc3..47e8ddc4d57 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/SignTransactionsStep/SignTransactionsStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/ManageContest/steps/SignTransactionsStep/SignTransactionsStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../../styles/shared'; +@import '../../../../../../../styles/shared'; .SignTransactionsStep { margin-top: 8px; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/useCommunityContests.ts b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/useCommunityContests.ts index 131acdd3efe..3bc1ef78675 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/useCommunityContests.ts +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Contests/useCommunityContests.ts @@ -8,17 +8,19 @@ import { isContestActive } from './utils'; type UseCommunityContestsProps = | { shouldPolling?: boolean; + fetchAll?: boolean; } | undefined; const useCommunityContests = (props?: UseCommunityContestsProps) => { - const { shouldPolling = false } = props || {}; + const { shouldPolling = false, fetchAll = false } = props || {}; const { stakeEnabled } = useCommunityStake(); const { data: contestsData, isLoading: isContestDataLoading } = useGetContestsQuery({ community_id: app.activeChainId() || '', shouldPolling, + fetchAll, }); const { finishedContests, activeContests } = useMemo(() => { diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomTOS/CustomTOS.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomTOS/CustomTOS.scss index b41d80b5902..4d3a2d8b2b2 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomTOS/CustomTOS.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomTOS/CustomTOS.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CustomTOS { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomURL/CustomURL.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomURL/CustomURL.scss index 1e899d19adb..aa3738ecb68 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomURL/CustomURL.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/CustomURL/CustomURL.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CustomURL { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Directory/Directory.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Directory/Directory.scss index 9f72b6eb2c8..70d86f17872 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Directory/Directory.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Directory/Directory.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Directory { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.scss index ee86e5c3668..4b01bac588e 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Discord/Discord.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Discord { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Integrations.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Integrations.scss index 02693f45d41..95e088ed4bb 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Integrations.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Integrations.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .Integrations { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Snapshots/Snapshots.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Snapshots/Snapshots.scss index e96b2e2095b..0f02ab8d5ab 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Snapshots/Snapshots.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Snapshots/Snapshots.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Snapshots { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Stake/Stake.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Stake/Stake.scss index 26d6995279c..df5991d7495 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Stake/Stake.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Stake/Stake.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Stake { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.scss index 4ef71c24cda..9610745a784 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Integrations/Webhooks/Webhooks.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Webhooks { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/CanBeDisabled/CanBeDisabled.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/CanBeDisabled/CanBeDisabled.scss index 9e4be6b3ba0..b742720f919 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/CanBeDisabled/CanBeDisabled.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/CanBeDisabled/CanBeDisabled.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CanBeDisabled { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/ContractInfo/ContractInfo.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/ContractInfo/ContractInfo.scss index e38afe6d61d..6b5ea7458f7 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/ContractInfo/ContractInfo.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/ContractInfo/ContractInfo.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ContractInfo { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/StakeIntegration.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/StakeIntegration.scss index cf3f2acbc39..c4f78414bbf 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/StakeIntegration.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/StakeIntegration.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .StakeIntegration { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/Status/Status.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/Status/Status.scss index 025c76e8e2d..ebd37b9e1e0 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/Status/Status.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/StakeIntegration/Status/Status.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Status { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.scss index 4547b5c6811..802811b3b7a 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .CreateTopicSection { form { @@ -29,6 +29,22 @@ color: $neutral-700; } } + + .new-topic-template-section { + border-radius: 6px; + display: flex; + flex-direction: column; + gap: 16px; + + &.enabled { + padding: 12px; + background-color: $neutral-50; + + .QuillEditor { + background-color: white; + } + } + } } .actions { diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.tsx index c0f8b390dd7..b998f6de7e2 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/CreateTopicsSection/CreateTopicSection.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import useBrowserWindow from 'hooks/useBrowserWindow'; import { DeltaStatic } from 'quill'; import React, { useEffect, useState } from 'react'; @@ -41,13 +42,22 @@ export const CreateTopicSection = ({ const [nameErrorMsg, setNameErrorMsg] = useState(null); const [descErrorMsg, setDescErrorMsg] = useState(null); + const [newPostTemplateError, setNewPostTemplateError] = useState< + string | null + >(null); const [featuredInSidebar, setFeaturedInSidebar] = useState( topicFormData?.featuredInSidebar || false, ); + const [featuredInNewPost, setFeaturedInNewPost] = useState( + topicFormData?.featuredInNewPost || false, + ); const [name, setName] = useState(topicFormData?.name || ''); const [descriptionDelta, setDescriptionDelta] = useState( createDeltaFromText(topicFormData?.description || ''), ); + const [newPostTemplate, setNewPostTemplate] = useState( + createDeltaFromText(topicFormData?.newPostTemplate || ''), + ); const [characterCount, setCharacterCount] = useState(0); const { isWindowExtraSmall } = useBrowserWindow({}); @@ -93,6 +103,17 @@ export const CreateTopicSection = ({ } }, [descriptionDelta]); + useEffect(() => { + if ( + featuredInNewPost && + (newPostTemplate?.ops || [])?.[0]?.insert?.trim?.()?.length === 0 + ) { + setNewPostTemplateError('Topic template is required'); + } else { + setNewPostTemplateError(null); + } + }, [featuredInNewPost, newPostTemplate]); + const handleSubmit = ( values: z.infer, ) => { @@ -100,6 +121,11 @@ export const CreateTopicSection = ({ name: values.topicName, description: getTextFromDelta(descriptionDelta), featuredInSidebar, + featuredInNewPost, + newPostTemplate: + featuredInNewPost && newPostTemplate + ? JSON.stringify(newPostTemplate) + : '', }); onStepChange(CreateTopicStep.WVConsent); }; @@ -136,9 +162,7 @@ export const CreateTopicSection = ({ Character count: {characterCount}/250 - - Choose whether topic is featured in sidebar. - + Choose whether topic is featured +
+ + Featured topic in new post + + The topic template you add will be added as base text to + every new post within the topic. + +
+ } + checked={featuredInNewPost} + onChange={() => { + setFeaturedInNewPost(!featuredInNewPost); + }} + /> + {featuredInNewPost && ( + + )} +
+ {featuredInNewPost && ( + + )}
diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/ManageTopicsSection/ManageTopicsSection.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/ManageTopicsSection/ManageTopicsSection.scss index 9900f19cab2..42b03b151b2 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/ManageTopicsSection/ManageTopicsSection.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/ManageTopicsSection/ManageTopicsSection.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; @mixin topicRowStyles { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/TopicDetails.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/TopicDetails.scss index 98ae189d794..c33524d43db 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/TopicDetails.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/TopicDetails/TopicDetails.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .TopicDetails { header { diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.scss index 1857dcab4a7..726dae87d7a 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .Topics { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.tsx index f53ba055c3e..513ae22570c 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/Topics.tsx @@ -27,6 +27,8 @@ interface TopicFormRegular { name: string; description?: string; featuredInSidebar?: boolean; + featuredInNewPost?: boolean; + newPostTemplate?: string; } export interface TopicFormERC20 { @@ -94,8 +96,8 @@ export const Topics = () => { name: topicFormData.name, description: topicFormData.description, featured_in_sidebar: topicFormData.featuredInSidebar || false, - featured_in_new_post: false, - default_offchain_template: '', + featured_in_new_post: topicFormData.featuredInNewPost || false, + default_offchain_template: topicFormData.newPostTemplate || '', community_id: app.activeChainId() || '', ...(erc20 ? { diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVConsent/WVConsent.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVConsent/WVConsent.scss index 93115f55264..7097b85cb95 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVConsent/WVConsent.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVConsent/WVConsent.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .WVConsent { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVERC20Details/WVERC20Details.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVERC20Details/WVERC20Details.scss index 96c7ff8f33d..b3f2609093d 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVERC20Details/WVERC20Details.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVERC20Details/WVERC20Details.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .WVERC20Details { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVMethodSelection/WVMethodSelection.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVMethodSelection/WVMethodSelection.scss index c9d934b0d2a..b536c2e6103 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVMethodSelection/WVMethodSelection.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/Topics/WVMethodSelection/WVMethodSelection.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .WVMethodSelection { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/common/CommunityManagementLayout/CommunityManagementLayout.scss b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/common/CommunityManagementLayout/CommunityManagementLayout.scss index f44d4a7f9f7..d557f4c474f 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityManagement/common/CommunityManagementLayout/CommunityManagementLayout.scss +++ b/packages/commonwealth/client/scripts/views/pages/CommunityManagement/common/CommunityManagementLayout/CommunityManagementLayout.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CommunityManagementLayout { display: grid; diff --git a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/ComponentsShowcase.scss b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/ComponentsShowcase.scss index 3c349e00518..7a16988ade6 100644 --- a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/ComponentsShowcase.scss +++ b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/ComponentsShowcase.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .ComponentsShowcase { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Colors.showcase.tsx b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Colors.showcase.tsx index cba29ee7463..438939cdc63 100644 --- a/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Colors.showcase.tsx +++ b/packages/commonwealth/client/scripts/views/pages/ComponentsShowcase/components/Colors.showcase.tsx @@ -3,7 +3,7 @@ import { CWText } from 'views/components/component_kit/cw_text'; import { notifySuccess } from 'controllers/app/notifications'; import { saveToClipboard } from 'utils/clipboard'; -import colors from '../../../../../styles/mixins/colors.module.scss'; +import colors from '../../../../styles/mixins/colors.module.scss'; const colorKeys = [ 'neutral', diff --git a/packages/commonwealth/client/scripts/views/pages/Contests/Contests.scss b/packages/commonwealth/client/scripts/views/pages/Contests/Contests.scss index c23a845f553..fe2b11181fc 100644 --- a/packages/commonwealth/client/scripts/views/pages/Contests/Contests.scss +++ b/packages/commonwealth/client/scripts/views/pages/Contests/Contests.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .Contests { .description { diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/CreateCommunity.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/CreateCommunity.scss index 7cd2aee621d..7cfc4def9fd 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/CreateCommunity.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/CreateCommunity.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .CreateCommunity { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionStep.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionStep.scss index 2b3ca437598..1e6f4d769a8 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ActionStep { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionSteps.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionSteps.scss index 1792548e798..5fc7e86a04b 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionSteps.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/components/ActionSteps/ActionSteps.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ActionSteps { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityInformationStep/CommunityInformationStep.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityInformationStep/CommunityInformationStep.scss index 0c39a7c6515..480162bfe4b 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityInformationStep/CommunityInformationStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityInformationStep/CommunityInformationStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; $form-width: 596px; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.scss index 49fbf3bde2f..8e5340838aa 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/EnableStake/EnableStake.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .EnableStake { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/SignStakeTransactions/SignStakeTransactions.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/SignStakeTransactions/SignStakeTransactions.scss index cff0ddb5c16..526bdca3608 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/SignStakeTransactions/SignStakeTransactions.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityStakeStep/SignStakeTransactions/SignStakeTransactions.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .SignStakeTransactions { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityTypeStep/CommunityTypeStep.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityTypeStep/CommunityTypeStep.scss index f6408249fc0..54e569c3498 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityTypeStep/CommunityTypeStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/CommunityTypeStep/CommunityTypeStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CreateCommunityLoginModal { z-index: 100; diff --git a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/SuccessStep/SuccessStep.scss b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/SuccessStep/SuccessStep.scss index fef4d92dc56..6ba885f110c 100644 --- a/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/SuccessStep/SuccessStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/CreateCommunity/steps/SuccessStep/SuccessStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .SuccessStep { margin: 40px auto 0; diff --git a/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPage.scss b/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPage.scss index 29bd8459592..ab6a98faf26 100644 --- a/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPage.scss +++ b/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPage.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .DirectoryPage { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPageContent.scss b/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPageContent.scss index 1c548a8b6f1..5c395a7aa84 100644 --- a/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPageContent.scss +++ b/packages/commonwealth/client/scripts/views/pages/DirectoryPage/DirectoryPageContent.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .directory-loader-container { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/LaunchToken/LaunchToken.scss b/packages/commonwealth/client/scripts/views/pages/LaunchToken/LaunchToken.scss index 855ba4271cf..96c01eed471 100644 --- a/packages/commonwealth/client/scripts/views/pages/LaunchToken/LaunchToken.scss +++ b/packages/commonwealth/client/scripts/views/pages/LaunchToken/LaunchToken.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .LaunchToken { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/CommunityInformationStep/CommunityInformationStep.scss b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/CommunityInformationStep/CommunityInformationStep.scss index 8a858a0f9f3..f3062f52c77 100644 --- a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/CommunityInformationStep/CommunityInformationStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/CommunityInformationStep/CommunityInformationStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; $form-width: 596px; diff --git a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SignatureStep/SignTokenTransactions/SignTokenTransactions.scss b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SignatureStep/SignTokenTransactions/SignTokenTransactions.scss index 47cbabe6041..6b51f99805c 100644 --- a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SignatureStep/SignTokenTransactions/SignTokenTransactions.scss +++ b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SignatureStep/SignTokenTransactions/SignTokenTransactions.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; $form-width: 596px; diff --git a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SuccessStep/SuccessStep.scss b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SuccessStep/SuccessStep.scss index f776252c873..3902904e103 100644 --- a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SuccessStep/SuccessStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/SuccessStep/SuccessStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .SuccessStep { margin: 40px auto 0; diff --git a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationForm/TokenInformationForm.scss b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationForm/TokenInformationForm.scss index e09468dd25a..2f4dbe08b14 100644 --- a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationForm/TokenInformationForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationForm/TokenInformationForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared.scss'; +@import '../../../../../../styles/shared.scss'; .TokenInformationForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationStep.scss b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationStep.scss index a99ac7e490f..ddb67a65634 100644 --- a/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationStep.scss +++ b/packages/commonwealth/client/scripts/views/pages/LaunchToken/steps/TokenInformationStep/TokenInformationStep.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; $form-width: 596px; diff --git a/packages/commonwealth/client/scripts/views/pages/MarkdownViewerPage/MarkdownViewerPage.tsx b/packages/commonwealth/client/scripts/views/pages/MarkdownViewerPage/MarkdownViewerPage.tsx index f11b515cca4..ccb7adf0bdf 100644 --- a/packages/commonwealth/client/scripts/views/pages/MarkdownViewerPage/MarkdownViewerPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/MarkdownViewerPage/MarkdownViewerPage.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useSearchParams } from 'react-router-dom'; import MarkdownViewer from 'views/components/MarkdownViewer'; import { QuillRenderer } from 'views/components/react_quill_editor/quill_renderer'; -import '../../../../styles/index.scss'; +import '../../../styles/index.scss'; import './MarkdownViewerPage.scss'; import supported from 'views/components/MarkdownEditor/markdown/supported.md?raw'; diff --git a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/MyCommunityStake.scss b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/MyCommunityStake.scss index fcf3f7c9046..3645473fbed 100644 --- a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/MyCommunityStake.scss +++ b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/MyCommunityStake.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .MyCommunityStake { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.scss b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.scss index e275e5eec3f..a8f301c1c76 100644 --- a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.scss +++ b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/NoTransactionHistory/NoTransactionHistory.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .NoTransactionHistory { width: 100%; diff --git a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Stakes/Stakes.scss b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Stakes/Stakes.scss index 6052697fc9e..dcf64fc2222 100644 --- a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Stakes/Stakes.scss +++ b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Stakes/Stakes.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .Stakes { .Table { diff --git a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Transactions/Transactions.scss b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Transactions/Transactions.scss index 30d7f8be0c1..20fce4e5c09 100644 --- a/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Transactions/Transactions.scss +++ b/packages/commonwealth/client/scripts/views/pages/MyCommunityStake/Transactions/Transactions.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .Transactions { .Table { diff --git a/packages/commonwealth/client/scripts/views/pages/NotificationSettings/index.scss b/packages/commonwealth/client/scripts/views/pages/NotificationSettings/index.scss index 65aff5f9e9d..64a35514684 100644 --- a/packages/commonwealth/client/scripts/views/pages/NotificationSettings/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/NotificationSettings/index.scss @@ -1,4 +1,4 @@ -@import '../../../../styles/shared'; +@import '../../../styles/shared'; .NotificationSettings { max-width: 650px; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/MultipleSnapshots.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/MultipleSnapshots.scss index fb3dbcd2bef..2ca24d2da8f 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/MultipleSnapshots.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/MultipleSnapshots.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .MultipleSnapshots { flex: 1; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/SnapshotSpaceCard/SnapshotSpaceCard.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/SnapshotSpaceCard/SnapshotSpaceCard.scss index 8a7050748ad..7dc27deaa22 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/SnapshotSpaceCard/SnapshotSpaceCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/MultipleSnapshots/SnapshotSpaceCard/SnapshotSpaceCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .SnapshotSpaceCard.Card { width: 260px; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposal.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposal.scss index 5a15d32a0e6..cf224722b98 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposal.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposal.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .NewSnapshotProposal { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposalForm/NewSnapshotProposalForm.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposalForm/NewSnapshotProposalForm.scss index 9e135c0fecf..4ade0fae564 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposalForm/NewSnapshotProposalForm.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/NewSnapshotProposal/NewSnapshotProposalForm/NewSnapshotProposalForm.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .NewSnapshotProposalForm { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposalCard/SnapshotProposalCard.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposalCard/SnapshotProposalCard.scss index dd364faf797..e54e5d9d6af 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposalCard/SnapshotProposalCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposalCard/SnapshotProposalCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ProposalCard.Card { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposals.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposals.scss index 6a8898eff00..8a7dd549f79 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposals.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/SnapshotProposals/SnapshotProposals.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .SnapshotProposals { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInfoRow/SnapshotInfoRow.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInfoRow/SnapshotInfoRow.scss index 71f2bf13d12..f2b1a029597 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInfoRow/SnapshotInfoRow.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInfoRow/SnapshotInfoRow.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .SnapshotInfoRow { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInformationCard.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInformationCard.scss index e9ea558270f..222fffafb2c 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInformationCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotInformationCard/SnapshotInformationCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .SnapshotInformationCard { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotVotesTable/SnapshotVotesTable.scss b/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotVotesTable/SnapshotVotesTable.scss index 1cb3b1ca7a0..33642486b43 100644 --- a/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotVotesTable/SnapshotVotesTable.scss +++ b/packages/commonwealth/client/scripts/views/pages/Snapshots/ViewSnapshotProposal/SnapshotVotesTable/SnapshotVotesTable.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .SnapshotVotesTable { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.scss b/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.scss index a44b95929cd..3ae4dfbb31c 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .thread-connectors-container { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.tsx b/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.tsx index 31b60e6e3f5..ef5c6e3823e 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.tsx +++ b/packages/commonwealth/client/scripts/views/pages/discussions/CommentCard/CommentCard.tsx @@ -7,6 +7,7 @@ import { deserializeCanvas, verify, } from '@hicommonwealth/shared'; +import { ReactQuillEditor } from 'client/scripts/views/components/react_quill_editor'; import clsx from 'clsx'; import { GetThreadActionTooltipTextResponse } from 'helpers/threads'; import useRunOnceOnCondition from 'hooks/useRunOnceOnCondition'; @@ -27,7 +28,6 @@ import { CWButton } from 'views/components/component_kit/new_designs/CWButton'; import { CWTag } from 'views/components/component_kit/new_designs/CWTag'; import { CWTooltip } from 'views/components/component_kit/new_designs/CWTooltip'; import { CWThreadAction } from 'views/components/component_kit/new_designs/cw_thread_action'; -import { ReactQuillEditor } from 'views/components/react_quill_editor'; import { deserializeDelta } from 'views/components/react_quill_editor/utils'; import { ToggleCommentSubscribe } from 'views/pages/discussions/CommentCard/ToggleCommentSubscribe'; import { AuthorAndPublishInfo } from '../ThreadCard/AuthorAndPublishInfo'; @@ -104,9 +104,11 @@ export const CommentCard = ({ const userOwnsComment = comment.profile.userId === user.id; const [commentText, setCommentText] = useState(comment.text); - const commentBody = deserializeDelta( - (editDraft || commentText) ?? comment.text, - ); + const commentBody = React.useMemo(() => { + const rawContent = editDraft || commentText || comment.text; + const deserializedContent = deserializeDelta(rawContent); + return deserializedContent; + }, [editDraft, commentText, comment.text]); const [commentDelta, setCommentDelta] = useState(commentBody); const author = comment?.author && app?.chain?.accounts @@ -121,7 +123,9 @@ export const CommentCard = ({ const [contentUrlBodyToFetch, setContentUrlBodyToFetch] = useState< string | null >(null); - + useEffect(() => { + setCommentDelta(commentBody); + }, [commentBody]); useRunOnceOnCondition({ callback: () => { comment.contentUrl && setContentUrlBodyToFetch(comment.contentUrl); diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.scss b/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.scss index 8367c312d7c..98e1e1c7521 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .CommentsTree { display: flex; diff --git a/packages/commonwealth/client/styles/pages/discussions/index.scss b/packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.scss similarity index 96% rename from packages/commonwealth/client/styles/pages/discussions/index.scss rename to packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.scss index 5c2a9c51529..5b0e70e0823 100644 --- a/packages/commonwealth/client/styles/pages/discussions/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; $size: 48px; @@ -9,6 +9,7 @@ $size: 48px; .layout-container { height: 100%; + margin-top: 10px; } .BreadcrumbsPageLayout { diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.tsx b/packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.tsx index ee5c883b811..3c7bdf41057 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/discussions/DiscussionsPage.tsx @@ -24,7 +24,6 @@ import { getThreadActionTooltipText } from 'helpers/threads'; import useBrowserWindow from 'hooks/useBrowserWindow'; import useManageDocumentTitle from 'hooks/useManageDocumentTitle'; import useTopicGating from 'hooks/useTopicGating'; -import 'pages/discussions/index.scss'; import { useFetchCustomDomainQuery } from 'state/api/configuration'; import { useGetERC20BalanceQuery } from 'state/api/tokens'; import Permissions from 'utils/Permissions'; @@ -41,6 +40,7 @@ import { CWText } from '../../components/component_kit/cw_text'; import CWIconButton from '../../components/component_kit/new_designs/CWIconButton'; import OverviewPage from '../overview'; import { DiscussionsFeedDiscovery } from './DiscussionsFeedDiscovery'; +import './DiscussionsPage.scss'; import { EmptyThreadsPlaceholder } from './EmptyThreadsPlaceholder'; type DiscussionsPageProps = { diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/EmptyThreadsPlaceholder/EmptyThreadsPlaceholder.scss b/packages/commonwealth/client/scripts/views/pages/discussions/EmptyThreadsPlaceholder/EmptyThreadsPlaceholder.scss index 8e2c61c5f84..209a5e5b3cf 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/EmptyThreadsPlaceholder/EmptyThreadsPlaceholder.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/EmptyThreadsPlaceholder/EmptyThreadsPlaceholder.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .EmptyThreadsSkeletonContainer { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.scss b/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.scss index 044243e481e..9a32af3662e 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .HeaderWithFilters { background-color: $white; @@ -60,9 +60,9 @@ @include smallInclusive { .filter-row { - flex-direction: column; + flex-direction: row; align-items: flex-start; - gap: 8px; + gap: 2px; } } @@ -70,7 +70,7 @@ margin-top: 0; .filter-section-right { - flex-direction: column; + flex-direction: row; align-items: flex-start; } diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.tsx b/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.tsx index 5823ed675b5..5c9da1d5a02 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.tsx +++ b/packages/commonwealth/client/scripts/views/pages/discussions/HeaderWithFilters/HeaderWithFilters.tsx @@ -4,7 +4,7 @@ import useBrowserWindow from 'hooks/useBrowserWindow'; import moment from 'moment/moment'; import { useCommonNavigate } from 'navigation/helpers'; import React, { useEffect, useRef, useState } from 'react'; -import { matchRoutes, useLocation } from 'react-router-dom'; +import { matchRoutes, useLocation, useSearchParams } from 'react-router-dom'; import app from 'state'; import { useGetCommunityByIdQuery } from 'state/api/communities'; import { useFetchTopicsQuery } from 'state/api/topics'; @@ -93,6 +93,12 @@ export const HeaderWithFilters = ({ const user = useUserStore(); + const [searchParams] = useSearchParams(); + const contestAddress = searchParams.get('contest'); + + const createButtonText = + activeContests.length || contestAddress ? 'Create' : 'Create thread'; + const onFilterResize = () => { if (filterRowRef.current) { setRightFiltersDropdownPosition( @@ -261,7 +267,7 @@ export const HeaderWithFilters = ({ { navigate( @@ -296,7 +302,7 @@ export const HeaderWithFilters = ({ // @ts-expect-error
-

Sort

+ {!isWindowExtraSmall &&

Sort

} )} - {matchesContestFilterRoute ? ( + {!isWindowExtraSmall && matchesContestFilterRoute ? ( @@ -466,34 +473,36 @@ export const HeaderWithFilters = ({ /> ) )} - { + onFilterSelect({ + filterKey: 'dateRange', + filterVal: item.value as ThreadTimelineFilterTypes, + }); + }} + options={[ + { + id: 1, + value: ThreadTimelineFilterTypes.AllTime, + label: 'All Time', + }, + { + id: 2, + value: ThreadTimelineFilterTypes.ThisMonth, + label: 'Month', + }, + { + id: 3, + value: ThreadTimelineFilterTypes.ThisWeek, + label: 'Week', + }, + ]} + dropdownPosition={rightFiltersDropdownPosition} + /> + )}
diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/AuthorAndPublishInfo/AuthorAndPublishInfo.scss b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/AuthorAndPublishInfo/AuthorAndPublishInfo.scss index 7945635197f..2dfd6d52ce6 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/AuthorAndPublishInfo/AuthorAndPublishInfo.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/AuthorAndPublishInfo/AuthorAndPublishInfo.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .AuthorAndPublishInfo { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/Options/index.scss b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/Options/index.scss index 7702cfb77e9..4ef39cfd349 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/Options/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/Options/index.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .Options { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadCard.scss b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadCard.scss index 17d18f0ba81..406e18535d3 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .ThreadCard { cursor: pointer; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.scss b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.scss index 0567a4eaa85..0d512fac666 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .AdminActions { .danger { diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ReactionButton/ReactionButtonSkeleton.scss b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ReactionButton/ReactionButtonSkeleton.scss index 021344e4db5..7a79da4e9f7 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ReactionButton/ReactionButtonSkeleton.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ReactionButton/ReactionButtonSkeleton.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../styles/shared'; +@import '../../../../../../styles/shared'; .ReactionButtonSkeleton { border: none; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ThreadOptions.scss b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ThreadOptions.scss index 6d4c3d9cf98..3e33b15571b 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ThreadOptions.scss +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/ThreadOptions.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .ThreadOptions { display: flex; diff --git a/packages/commonwealth/client/styles/pages/loading.scss b/packages/commonwealth/client/scripts/views/pages/loading.scss similarity index 100% rename from packages/commonwealth/client/styles/pages/loading.scss rename to packages/commonwealth/client/scripts/views/pages/loading.scss diff --git a/packages/commonwealth/client/scripts/views/pages/loading.tsx b/packages/commonwealth/client/scripts/views/pages/loading.tsx index 9886b9345a8..9e518af4744 100644 --- a/packages/commonwealth/client/scripts/views/pages/loading.tsx +++ b/packages/commonwealth/client/scripts/views/pages/loading.tsx @@ -1,7 +1,7 @@ -import 'pages/loading.scss'; import React from 'react'; import { CWText } from '../components/component_kit/cw_text'; import CWCircleMultiplySpinner from '../components/component_kit/new_designs/CWCircleMultiplySpinner'; +import './loading.scss'; type PageLoadingProps = { message?: string; diff --git a/packages/commonwealth/client/styles/pages/new_profile.scss b/packages/commonwealth/client/scripts/views/pages/new_profile.scss similarity index 70% rename from packages/commonwealth/client/styles/pages/new_profile.scss rename to packages/commonwealth/client/scripts/views/pages/new_profile.scss index 8a1c648b8eb..6628da541da 100644 --- a/packages/commonwealth/client/styles/pages/new_profile.scss +++ b/packages/commonwealth/client/scripts/views/pages/new_profile.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .ProfilePage { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/new_profile.tsx b/packages/commonwealth/client/scripts/views/pages/new_profile.tsx index b7912e93577..85e9e0ce39a 100644 --- a/packages/commonwealth/client/scripts/views/pages/new_profile.tsx +++ b/packages/commonwealth/client/scripts/views/pages/new_profile.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import 'pages/new_profile.scss'; +import './new_profile.scss'; import Profile from '../components/Profile'; diff --git a/packages/commonwealth/client/styles/pages/new_proposal/index.scss b/packages/commonwealth/client/scripts/views/pages/new_proposal/index.scss similarity index 69% rename from packages/commonwealth/client/styles/pages/new_proposal/index.scss rename to packages/commonwealth/client/scripts/views/pages/new_proposal/index.scss index 05f21353270..522add1607a 100644 --- a/packages/commonwealth/client/styles/pages/new_proposal/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/new_proposal/index.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .NewProposalPage { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/new_proposal/index.tsx b/packages/commonwealth/client/scripts/views/pages/new_proposal/index.tsx index 7294ea1e65e..a1f5faf1d68 100644 --- a/packages/commonwealth/client/scripts/views/pages/new_proposal/index.tsx +++ b/packages/commonwealth/client/scripts/views/pages/new_proposal/index.tsx @@ -1,6 +1,5 @@ import { ChainBase } from '@hicommonwealth/shared'; import { useInitChainIfNeeded } from 'hooks/useInitChainIfNeeded'; -import 'pages/new_proposal/index.scss'; import React, { useEffect, useState } from 'react'; import app from 'state'; import { userStore } from 'state/ui/user'; @@ -9,6 +8,7 @@ import { PageLoading } from 'views/pages/loading'; import { CWText } from '../../components/component_kit/cw_text'; import { PageNotFound } from '../404'; import { CosmosProposalForm } from './cosmos_proposal_form'; +import './index.scss'; /// NOTE: THIS PAGE IS ONLY ACCESSIBLE FOR COSMOS CHAINS, FOLLOWING /// DEPRECATION OF OTHER GOVERNANCE FORMS, AND IS CONSIDERED LEGACY. diff --git a/packages/commonwealth/client/scripts/views/pages/old_terms.tsx b/packages/commonwealth/client/scripts/views/pages/old_terms.tsx index 22a89a7782c..60c29f2bf9b 100644 --- a/packages/commonwealth/client/scripts/views/pages/old_terms.tsx +++ b/packages/commonwealth/client/scripts/views/pages/old_terms.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { renderMultilineText } from 'helpers'; -import 'pages/privacy_and_terms.scss'; +import './privacy_and_terms.scss'; import { CWText } from '../components/component_kit/cw_text'; import Sublayout from '../Sublayout'; diff --git a/packages/commonwealth/client/styles/pages/overview/TopicSummaryRow.scss b/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.scss similarity index 98% rename from packages/commonwealth/client/styles/pages/overview/TopicSummaryRow.scss rename to packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.scss index 75601d2ecec..0640803f59a 100644 --- a/packages/commonwealth/client/styles/pages/overview/TopicSummaryRow.scss +++ b/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .TopicSummaryRow { border-bottom: 1px solid $neutral-200; diff --git a/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.tsx b/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.tsx index 14455c89e49..c66fb526c40 100644 --- a/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.tsx +++ b/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRow.tsx @@ -4,7 +4,6 @@ import { getThreadActionTooltipText } from 'helpers/threads'; import useTopicGating from 'hooks/useTopicGating'; import { getProposalUrlPath } from 'identifiers'; import { useCommonNavigate } from 'navigation/helpers'; -import 'pages/overview/TopicSummaryRow.scss'; import React from 'react'; import app from 'state'; import useUserStore from 'state/ui/user'; @@ -13,6 +12,7 @@ import type Thread from '../../../models/Thread'; import type { Topic } from '../../../models/Topic'; import { CWText } from '../../components/component_kit/cw_text'; import { ThreadCard } from '../discussions/ThreadCard'; +import './TopicSummaryRow.scss'; import { TopicSummaryRowSkeleton } from './TopicSummaryRowSkeleton'; type TopicSummaryRowProps = { diff --git a/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRowSkeleton.tsx b/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRowSkeleton.tsx index 7a750f644e5..13cb2e9b816 100644 --- a/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRowSkeleton.tsx +++ b/packages/commonwealth/client/scripts/views/pages/overview/TopicSummaryRowSkeleton.tsx @@ -1,8 +1,8 @@ -import 'pages/overview/TopicSummaryRow.scss'; import React from 'react'; import { Skeleton } from '../../components/Skeleton'; import { CWDivider } from '../../components/component_kit/cw_divider'; import { getClasses } from '../../components/component_kit/helpers'; +import './TopicSummaryRow.scss'; export const TopicSummaryRowSkeleton = () => { return ( @@ -20,7 +20,7 @@ export const TopicSummaryRowSkeleton = () => {
( { isLoading: true }, - 'recent-thread-row' + 'recent-thread-row', )} > diff --git a/packages/commonwealth/client/styles/pages/overview/index.scss b/packages/commonwealth/client/scripts/views/pages/overview/index.scss similarity index 95% rename from packages/commonwealth/client/styles/pages/overview/index.scss rename to packages/commonwealth/client/scripts/views/pages/overview/index.scss index 709c3469c2c..526a7575d1c 100644 --- a/packages/commonwealth/client/styles/pages/overview/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/overview/index.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .OverviewPage { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/overview/index.tsx b/packages/commonwealth/client/scripts/views/pages/overview/index.tsx index 4351b5dd2b7..c4702cf9c6c 100644 --- a/packages/commonwealth/client/scripts/views/pages/overview/index.tsx +++ b/packages/commonwealth/client/scripts/views/pages/overview/index.tsx @@ -1,8 +1,6 @@ import { splitAndDecodeURL } from '@hicommonwealth/shared'; import useRunOnceOnCondition from 'client/scripts/hooks/useRunOnceOnCondition'; import { useCommonNavigate } from 'navigation/helpers'; -import 'pages/discussions/index.scss'; -import 'pages/overview/index.scss'; import React from 'react'; import app from 'state'; import { useFetchThreadsQuery } from 'state/api/threads'; @@ -11,8 +9,10 @@ import type Thread from '../../../models/Thread'; import type { Topic } from '../../../models/Topic'; import { CWDivider } from '../../components/component_kit/cw_divider'; import { CWText } from '../../components/component_kit/cw_text'; +import '../discussions/DiscussionsPage.scss'; import { PageLoading } from '../loading'; import { TopicSummaryRow } from './TopicSummaryRow'; +import './index.scss'; const OverviewPage = () => { const navigate = useCommonNavigate(); diff --git a/packages/commonwealth/client/scripts/views/pages/privacy.tsx b/packages/commonwealth/client/scripts/views/pages/privacy.tsx index e017380e9a9..6f49f73b679 100644 --- a/packages/commonwealth/client/scripts/views/pages/privacy.tsx +++ b/packages/commonwealth/client/scripts/views/pages/privacy.tsx @@ -1,7 +1,7 @@ /* eslint-disable max-len */ -import 'pages/privacy_and_terms.scss'; import React from 'react'; import { CWText } from '../components/component_kit/cw_text'; +import './privacy_and_terms.scss'; const PrivacyPage = () => { return ( diff --git a/packages/commonwealth/client/styles/pages/privacy_and_terms.scss b/packages/commonwealth/client/scripts/views/pages/privacy_and_terms.scss similarity index 97% rename from packages/commonwealth/client/styles/pages/privacy_and_terms.scss rename to packages/commonwealth/client/scripts/views/pages/privacy_and_terms.scss index ef522a4d726..0273e995399 100644 --- a/packages/commonwealth/client/styles/pages/privacy_and_terms.scss +++ b/packages/commonwealth/client/scripts/views/pages/privacy_and_terms.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .PrivacyPage { align-items: center; diff --git a/packages/commonwealth/client/styles/pages/proposals.scss b/packages/commonwealth/client/scripts/views/pages/proposals.scss similarity index 88% rename from packages/commonwealth/client/styles/pages/proposals.scss rename to packages/commonwealth/client/scripts/views/pages/proposals.scss index 7216afedffb..5c2ec076173 100644 --- a/packages/commonwealth/client/styles/pages/proposals.scss +++ b/packages/commonwealth/client/scripts/views/pages/proposals.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .ProposalsPage { flex: 1; diff --git a/packages/commonwealth/client/scripts/views/pages/proposals.tsx b/packages/commonwealth/client/scripts/views/pages/proposals.tsx index b34cf7da1d2..7ed9f6b39bb 100644 --- a/packages/commonwealth/client/scripts/views/pages/proposals.tsx +++ b/packages/commonwealth/client/scripts/views/pages/proposals.tsx @@ -1,6 +1,5 @@ import { ChainBase } from '@hicommonwealth/shared'; import { useInitChainIfNeeded } from 'hooks/useInitChainIfNeeded'; -import 'pages/proposals.scss'; import React, { useEffect, useState } from 'react'; import app from 'state'; import { @@ -20,6 +19,7 @@ import useManageDocumentTitle from '../../hooks/useManageDocumentTitle'; import { CardsCollection } from '../components/cards_collection'; import { CWText } from '../components/component_kit/cw_text'; import CWCircleMultiplySpinner from '../components/component_kit/new_designs/CWCircleMultiplySpinner'; +import './proposals.scss'; const ProposalsPage = () => { const [isLoading, setLoading] = useState( diff --git a/packages/commonwealth/client/scripts/views/pages/search/helpers.tsx b/packages/commonwealth/client/scripts/views/pages/search/helpers.tsx index 4ea885eb147..7fd1a8e0f03 100644 --- a/packages/commonwealth/client/scripts/views/pages/search/helpers.tsx +++ b/packages/commonwealth/client/scripts/views/pages/search/helpers.tsx @@ -1,7 +1,6 @@ import { SearchUserProfilesView } from '@hicommonwealth/schemas'; import { getDecodedString } from '@hicommonwealth/shared'; import moment from 'moment'; -import 'pages/search/index.scss'; import React, { useMemo } from 'react'; import app from 'state'; import { useFetchCustomDomainQuery } from 'state/api/configuration'; @@ -14,6 +13,7 @@ import { CWText } from '../../components/component_kit/cw_text'; import { renderTruncatedHighlights } from '../../components/react_quill_editor/highlighter'; import { QuillRenderer } from '../../components/react_quill_editor/quill_renderer'; import { User } from '../../components/user/user'; +import './index.scss'; export type ThreadResult = { id: number; diff --git a/packages/commonwealth/client/styles/pages/search/index.scss b/packages/commonwealth/client/scripts/views/pages/search/index.scss similarity index 98% rename from packages/commonwealth/client/styles/pages/search/index.scss rename to packages/commonwealth/client/scripts/views/pages/search/index.scss index d40770e838e..f8fd05d4d65 100644 --- a/packages/commonwealth/client/styles/pages/search/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/search/index.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin searchRowStyles { align-items: center; diff --git a/packages/commonwealth/client/scripts/views/pages/search/index.tsx b/packages/commonwealth/client/scripts/views/pages/search/index.tsx index 98adb783a53..a5c60b0448d 100644 --- a/packages/commonwealth/client/scripts/views/pages/search/index.tsx +++ b/packages/commonwealth/client/scripts/views/pages/search/index.tsx @@ -6,8 +6,8 @@ import { SearchSort, VALID_SEARCH_SCOPES, } from 'models/SearchQuery'; -import 'pages/search/index.scss'; import useSidebarStore from 'state/ui/sidebar'; +import './index.scss'; import useWindowResize from 'hooks/useWindowResize'; import React, { useEffect, useMemo } from 'react'; diff --git a/packages/commonwealth/client/styles/pages/stats.scss b/packages/commonwealth/client/scripts/views/pages/stats.scss similarity index 95% rename from packages/commonwealth/client/styles/pages/stats.scss rename to packages/commonwealth/client/scripts/views/pages/stats.scss index 056d1fdbdf6..1d09b9bb6c3 100644 --- a/packages/commonwealth/client/styles/pages/stats.scss +++ b/packages/commonwealth/client/scripts/views/pages/stats.scss @@ -1,4 +1,4 @@ -@import '../shared'; +@import '../../styles/shared.scss'; .StatsPage { flex: 1; diff --git a/packages/commonwealth/client/scripts/views/pages/stats.tsx b/packages/commonwealth/client/scripts/views/pages/stats.tsx index 1efdae7e4c3..1436ee30a07 100644 --- a/packages/commonwealth/client/scripts/views/pages/stats.tsx +++ b/packages/commonwealth/client/scripts/views/pages/stats.tsx @@ -1,6 +1,5 @@ import axios from 'axios'; import useNecessaryEffect from 'hooks/useNecessaryEffect'; -import 'pages/stats.scss'; import React, { useState } from 'react'; import app from 'state'; import { SERVER_URL } from 'state/api/config'; @@ -9,6 +8,7 @@ import CWPageLayout from 'views/components/component_kit/new_designs/CWPageLayou import ErrorPage from 'views/pages/error'; import { PageLoading } from 'views/pages/loading'; import { CWText } from '../components/component_kit/cw_text'; +import './stats.scss'; type Batchable = { date: string; diff --git a/packages/commonwealth/client/scripts/views/pages/terms.tsx b/packages/commonwealth/client/scripts/views/pages/terms.tsx index 6ab81dc3689..9fbbb3fc1ea 100644 --- a/packages/commonwealth/client/scripts/views/pages/terms.tsx +++ b/packages/commonwealth/client/scripts/views/pages/terms.tsx @@ -1,9 +1,9 @@ import { renderMultilineText } from 'helpers'; import { useCommonNavigate } from 'navigation/helpers'; /* eslint-disable max-len */ -import 'pages/privacy_and_terms.scss'; import React from 'react'; import { CWText } from '../components/component_kit/cw_text'; +import './privacy_and_terms.scss'; const TOS = `Terms of Services PLEASE READ THE BELOW GOVERNANCE PLATFORM SERVICES AGREEMENT VERY CAREFULLY. THE BELOW GOVERNANCE PLATFORM SERVICES AGREEMENT IS A LEGALLY BINDING CONTRACT BETWEEN YOU AND COW MOON WEALTH SOFTWARE INC. THAT SETS FORTH AND DETERMINES, AMONG OTHER THINGS: diff --git a/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/CommunityPreviewCard/CommunityPreviewCard.scss b/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/CommunityPreviewCard/CommunityPreviewCard.scss index 08fc5bf561e..28896dccf31 100644 --- a/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/CommunityPreviewCard/CommunityPreviewCard.scss +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/CommunityPreviewCard/CommunityPreviewCard.scss @@ -1,4 +1,4 @@ -@import '../../../../../../styles/shared'; +@import '../../../../../styles/shared'; .CommunityPreviewCard.Card { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/TrendingCommunitiesPreview.scss b/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/TrendingCommunitiesPreview.scss index 423a47b2b53..8311ca9d406 100644 --- a/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/TrendingCommunitiesPreview.scss +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/TrendingCommunitiesPreview/TrendingCommunitiesPreview.scss @@ -1,4 +1,4 @@ -@import '../../../../../styles/shared'; +@import '../../../../styles/shared'; .TrendingCommunitiesPreview { display: flex; diff --git a/packages/commonwealth/client/styles/pages/user_dashboard/index.scss b/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.scss similarity index 97% rename from packages/commonwealth/client/styles/pages/user_dashboard/index.scss rename to packages/commonwealth/client/scripts/views/pages/user_dashboard/index.scss index b59b8fab8cd..1b5855dfbb4 100644 --- a/packages/commonwealth/client/styles/pages/user_dashboard/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .UserDashboard { padding-top: 20px; diff --git a/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx b/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx index 733286816a4..cd1cff6d5ee 100644 --- a/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx @@ -7,7 +7,6 @@ import { useBrowserAnalyticsTrack } from 'hooks/useBrowserAnalyticsTrack'; import useBrowserWindow from 'hooks/useBrowserWindow'; import { useFlag } from 'hooks/useFlag'; import { useCommonNavigate } from 'navigation/helpers'; -import 'pages/user_dashboard/index.scss'; import React, { useEffect, useRef } from 'react'; import useUserStore from 'state/ui/user'; import CWPageLayout from 'views/components/component_kit/new_designs/CWPageLayout'; @@ -24,6 +23,7 @@ import { } from '../../components/component_kit/new_designs/CWTabs'; import { Feed } from '../../components/feed'; import { TrendingCommunitiesPreview } from './TrendingCommunitiesPreview'; +import './index.scss'; export enum DashboardViews { ForYou = 'For You', diff --git a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row.scss b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.scss similarity index 96% rename from packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row.scss rename to packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.scss index 15a05077833..6af224801f9 100644 --- a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row.scss +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; @mixin rowTopTextStyles { display: inline-block; diff --git a/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.tsx b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.tsx index 57ee4f51514..8408b32e83a 100644 --- a/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.tsx +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row.tsx @@ -1,8 +1,8 @@ -import 'pages/user_dashboard/user_dashboard_row.scss'; -import 'pages/user_dashboard/user_dashboard_row_top.scss'; import React from 'react'; import { Skeleton } from 'views/components/Skeleton'; import { CWText } from 'views/components/component_kit/cw_text'; +import './user_dashboard_row.scss'; +import './user_dashboard_row_top.scss'; export const UserDashboardRowSkeleton = () => { return ( diff --git a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row_bottom.scss b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row_bottom.scss similarity index 84% rename from packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row_bottom.scss rename to packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row_bottom.scss index eea1e1dc299..d32a0c201d4 100644 --- a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row_bottom.scss +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row_bottom.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .UserDashboardRowBottom { display: flex; diff --git a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row_top.scss b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row_top.scss similarity index 91% rename from packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row_top.scss rename to packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row_top.scss index 9d99cb7de95..087a536066f 100644 --- a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_row_top.scss +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/user_dashboard_row_top.scss @@ -1,5 +1,5 @@ -@import '../../shared'; -@import 'user_dashboard_row.scss'; +@import '../../../styles/shared.scss'; +@import './user_dashboard_row.scss'; .UserDashboardRowTop { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/view_proposal/JSONDisplay.tsx b/packages/commonwealth/client/scripts/views/pages/view_proposal/JSONDisplay.tsx index 20e977e9364..805b8968e7d 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_proposal/JSONDisplay.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_proposal/JSONDisplay.tsx @@ -1,5 +1,4 @@ import { ChainNetwork } from '@hicommonwealth/shared'; -import 'components/proposals/json_display.scss'; import { CoinObject } from 'controllers/chain/cosmos/types'; import React from 'react'; import app from 'state'; @@ -10,6 +9,7 @@ import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { CWTooltip } from '../../components/component_kit/new_designs/CWTooltip'; import { openConfirmation } from '../../modals/confirmation_modal'; import JSONViewer from './JSONViewer'; +import './json_display.scss'; interface DataType { title?: string; diff --git a/packages/commonwealth/client/styles/components/proposals/json_display.scss b/packages/commonwealth/client/scripts/views/pages/view_proposal/json_display.scss similarity index 93% rename from packages/commonwealth/client/styles/components/proposals/json_display.scss rename to packages/commonwealth/client/scripts/views/pages/view_proposal/json_display.scss index a2999519876..7a9997cff6b 100644 --- a/packages/commonwealth/client/styles/components/proposals/json_display.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_proposal/json_display.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .BlobContainer { display: flex; diff --git a/packages/commonwealth/client/styles/pages/view_proposal/proposal_components.scss b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.scss similarity index 91% rename from packages/commonwealth/client/styles/pages/view_proposal/proposal_components.scss rename to packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.scss index 960e02bed6b..0d492fb5b07 100644 --- a/packages/commonwealth/client/styles/pages/view_proposal/proposal_components.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .ProposalSubheader { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.tsx b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.tsx index 9d9fb85f851..f8ddf9350c1 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_components.tsx @@ -3,7 +3,6 @@ import { extractDomain } from 'helpers'; import useNecessaryEffect from 'hooks/useNecessaryEffect'; import { LinkSource } from 'models/Thread'; import type { AnyProposal } from 'models/types'; -import 'pages/view_proposal/proposal_components.scss'; import React, { useState } from 'react'; import { SERVER_URL } from 'state/api/config'; import { userStore } from 'state/ui/user'; @@ -13,6 +12,7 @@ import { getStatusText, } from '../../components/ProposalCard/helpers'; import { CWText } from '../../components/component_kit/cw_text'; +import './proposal_components.scss'; import { ThreadLink } from './proposal_header_links'; type ProposalSubheaderProps = { diff --git a/packages/commonwealth/client/styles/pages/view_proposal/proposal_header_links.scss b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.scss similarity index 93% rename from packages/commonwealth/client/styles/pages/view_proposal/proposal_header_links.scss rename to packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.scss index 17763350a91..7e888972337 100644 --- a/packages/commonwealth/client/styles/pages/view_proposal/proposal_header_links.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .HeaderLink { cursor: pointer; diff --git a/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.tsx b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.tsx index d8e12621ea6..abdea1c495a 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_proposal/proposal_header_links.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; -import 'pages/view_proposal/proposal_header_links.scss'; +import './proposal_header_links.scss'; import { getDecodedString, ProposalType } from '@hicommonwealth/shared'; import { getProposalUrlPath } from 'identifiers'; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/LinkedUrlCard.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/LinkedUrlCard.tsx index eec5660cf37..d6f6347d976 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/LinkedUrlCard.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/LinkedUrlCard.tsx @@ -1,5 +1,4 @@ import { filterLinks } from 'helpers/threads'; -import 'pages/view_thread/linked_threads_card.scss'; import React, { useMemo, useState } from 'react'; import { Link } from 'react-router-dom'; import { CWModal } from 'views/components/component_kit/new_designs/CWModal'; @@ -9,6 +8,7 @@ import { CWContentPageCard } from '../../components/component_kit/CWContentPageC import { CWText } from '../../components/component_kit/cw_text'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { LinkedUrlModal } from '../../modals/linked_url_modal'; +import './linked_threads_card.scss'; type LinkedUrlCardProps = { thread: Thread; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollCard.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollCard.tsx index f61bb0f6130..632cf51ed47 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollCard.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollCard.tsx @@ -1,6 +1,5 @@ import { notifyError, notifySuccess } from 'controllers/app/notifications'; import moment from 'moment'; -import 'pages/view_thread/poll_cards.scss'; import React, { useState } from 'react'; import { useDeletePollMutation, useVotePollMutation } from 'state/api/polls'; import useUserStore from 'state/ui/user'; @@ -10,6 +9,7 @@ import { PollCard } from '../../components/Polls'; import { CWModal } from '../../components/component_kit/new_designs/CWModal'; import { OffchainVotingModal } from '../../modals/offchain_voting_modal'; import { getPollTimestamp } from './helpers'; +import './poll_cards.scss'; type ThreadPollCardProps = { poll: Poll; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollEditorCard.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollEditorCard.tsx index 8c6a2e345a8..13ae32d6e72 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollEditorCard.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/ThreadPollEditorCard.tsx @@ -1,10 +1,10 @@ -import 'pages/view_thread/poll_cards.scss'; import React, { useState } from 'react'; import type Thread from '../../../models/Thread'; import { CWContentPageCard } from '../../components/component_kit/CWContentPageCard'; import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { CWModal } from '../../components/component_kit/new_designs/CWModal'; import { PollEditorModal } from '../../modals/poll_editor_modal'; +import './poll_cards.scss'; type ThreadPollEditorCardProps = { thread: Thread; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/ViewThreadPage.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/ViewThreadPage.tsx index 36c345877c5..6902bd71787 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/ViewThreadPage.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/ViewThreadPage.tsx @@ -12,7 +12,6 @@ import useRunOnceOnCondition from 'hooks/useRunOnceOnCondition'; import useTopicGating from 'hooks/useTopicGating'; import moment from 'moment'; import { useCommonNavigate } from 'navigation/helpers'; -import 'pages/view_thread/index.scss'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import { Helmet } from 'react-helmet-async'; import { useSearchParams } from 'react-router-dom'; @@ -62,6 +61,7 @@ import { LinkedUrlCard } from './LinkedUrlCard'; import { ThreadPollCard } from './ThreadPollCard'; import { ThreadPollEditorCard } from './ThreadPollEditorCard'; import { EditBody } from './edit_body'; +import './index.scss'; import { LinkedProposalsCard } from './linked_proposals_card'; import { LinkedThreadsCard } from './linked_threads_card'; import { LockMessage } from './lock_message'; diff --git a/packages/commonwealth/client/styles/pages/view_thread/edit_body.scss b/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.scss similarity index 81% rename from packages/commonwealth/client/styles/pages/view_thread/edit_body.scss rename to packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.scss index d132ef776e8..8d3b16661b8 100644 --- a/packages/commonwealth/client/styles/pages/view_thread/edit_body.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .EditBody { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx index 0c6a24579ad..c46af7d5a29 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx @@ -3,7 +3,6 @@ import { buildUpdateThreadInput } from 'client/scripts/state/api/threads/editThr import { useAuthModalStore } from 'client/scripts/state/ui/modals'; import { notifyError, notifySuccess } from 'controllers/app/notifications'; import { SessionKeyError } from 'controllers/server/sessions'; -import 'pages/view_thread/edit_body.scss'; import type { DeltaStatic } from 'quill'; import React from 'react'; import app from 'state'; @@ -15,6 +14,7 @@ import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { ReactQuillEditor } from '../../components/react_quill_editor'; import { deserializeDelta } from '../../components/react_quill_editor/utils'; import { clearEditingLocalStorage } from '../discussions/CommentTree/helpers'; +import './edit_body.scss'; type EditBodyProps = { title: string; diff --git a/packages/commonwealth/client/styles/pages/view_thread/index.scss b/packages/commonwealth/client/scripts/views/pages/view_thread/index.scss similarity index 96% rename from packages/commonwealth/client/styles/pages/view_thread/index.scss rename to packages/commonwealth/client/scripts/views/pages/view_thread/index.scss index e9c9d6bb317..c11d7cf1f5e 100644 --- a/packages/commonwealth/client/styles/pages/view_thread/index.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/index.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .thread-content { display: flex; @@ -49,7 +49,6 @@ } } - .comments-filter-row { display: flex; justify-content: space-between; diff --git a/packages/commonwealth/client/styles/pages/view_thread/linked_proposals_card.scss b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.scss similarity index 93% rename from packages/commonwealth/client/styles/pages/view_thread/linked_proposals_card.scss rename to packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.scss index bf48c517bdc..72ed090e3e5 100644 --- a/packages/commonwealth/client/styles/pages/view_thread/linked_proposals_card.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .spinner-container { margin: auto; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.tsx index 8c649219c89..12c0fc221be 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_proposals_card.tsx @@ -4,7 +4,6 @@ import { filterLinks } from 'helpers/threads'; import { ProposalType } from '@hicommonwealth/shared'; import { getProposalUrlPath } from 'identifiers'; import { LinkSource } from 'models/Thread'; -import 'pages/view_thread/linked_proposals_card.scss'; import React, { useEffect, useMemo, useState } from 'react'; import { Link as ReactRouterLink } from 'react-router-dom'; import app from 'state'; @@ -16,6 +15,7 @@ import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import CWCircleMultiplySpinner from '../../components/component_kit/new_designs/CWCircleMultiplySpinner'; import { CWModal } from '../../components/component_kit/new_designs/CWModal'; import { UpdateProposalStatusModal } from '../../modals/update_proposal_status_modal'; +import './linked_proposals_card.scss'; type ThreadLinkProps = { threadChain: string; diff --git a/packages/commonwealth/client/styles/pages/view_thread/linked_threads_card.scss b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.scss similarity index 87% rename from packages/commonwealth/client/styles/pages/view_thread/linked_threads_card.scss rename to packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.scss index 35e0f2cf85e..2187cb168c1 100644 --- a/packages/commonwealth/client/styles/pages/view_thread/linked_threads_card.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .LinkedThreadsCard { display: flex; diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.tsx index ea0dea468a4..9dd3fe8d368 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/linked_threads_card.tsx @@ -1,7 +1,6 @@ import { slugify } from '@hicommonwealth/shared'; import { filterLinks } from 'helpers/threads'; import { getProposalUrlPath } from 'identifiers'; -import 'pages/view_thread/linked_threads_card.scss'; import React, { useMemo, useState } from 'react'; import { Link } from 'react-router-dom'; import app from 'state'; @@ -13,6 +12,7 @@ import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import CWCircleMultiplySpinner from '../../components/component_kit/new_designs/CWCircleMultiplySpinner'; import { CWModal } from '../../components/component_kit/new_designs/CWModal'; import { LinkedThreadModal } from '../../modals/linked_thread_modal'; +import './linked_threads_card.scss'; type LinkedThreadsCardProps = { thread: Thread; diff --git a/packages/commonwealth/client/styles/pages/view_thread/poll_cards.scss b/packages/commonwealth/client/scripts/views/pages/view_thread/poll_cards.scss similarity index 58% rename from packages/commonwealth/client/styles/pages/view_thread/poll_cards.scss rename to packages/commonwealth/client/scripts/views/pages/view_thread/poll_cards.scss index 3d1b3c465e8..2a36782a1da 100644 --- a/packages/commonwealth/client/styles/pages/view_thread/poll_cards.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/poll_cards.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .PollEditorCard { display: flex; diff --git a/packages/commonwealth/client/styles/pages/view_thread/snapshot_creation_card.scss b/packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.scss similarity index 80% rename from packages/commonwealth/client/styles/pages/view_thread/snapshot_creation_card.scss rename to packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.scss index 60a7be6baed..58368be0ff1 100644 --- a/packages/commonwealth/client/styles/pages/view_thread/snapshot_creation_card.scss +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.scss @@ -1,4 +1,4 @@ -@import '../../shared'; +@import '../../../styles/shared.scss'; .SnapshotCreationCard { display: flex; @@ -10,4 +10,4 @@ .no-threads-text.Text { color: $neutral-500; } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.tsx index fda0bf46e04..78035bc9d19 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/snapshot_creation_card.tsx @@ -5,7 +5,7 @@ import { CWButton } from '../../components/component_kit/new_designs/CWButton'; import { CWModal } from '../../components/component_kit/new_designs/CWModal'; import { NewSnapshotProposalModal } from '../../modals/new_snapshot_proposal_modal'; -import 'pages/view_thread/snapshot_creation_card.scss'; +import './snapshot_creation_card.scss'; import type Thread from '../../../models/Thread'; import { CWText } from '../../components/component_kit/cw_text'; diff --git a/packages/commonwealth/client/styles/Footer.scss b/packages/commonwealth/client/styles/Footer.scss deleted file mode 100644 index 89e4cfd46b9..00000000000 --- a/packages/commonwealth/client/styles/Footer.scss +++ /dev/null @@ -1,45 +0,0 @@ -@import 'shared'; - -.Footer { - margin-top: auto; - background: linear-gradient( - 92deg, - #fbfafd 0%, - #c4d0e6 50%, - #e7dee0 75%, - #c6d5dd 100% - ); - background-size: cover; - display: flex; - flex-wrap: wrap; - height: 240px; - justify-content: space-between; - min-height: 240px; - padding: 48px 24px; - - @include small { - padding: 24px; - } - - img { - height: 80px; - margin-bottom: 24px; - width: 80px; - } - - .footer-links-container { - align-items: flex-start; - display: flex; - flex-flow: column; - flex-wrap: wrap; - height: 128px; - width: 208px; - - .footer-link { - color: $neutral-800; - cursor: pointer; - height: 24px; - width: 104px; - } - } -} diff --git a/packages/commonwealth/client/styles/components/component_kit/cw_component_showcase.scss b/packages/commonwealth/client/styles/components/component_kit/cw_component_showcase.scss deleted file mode 100644 index 3fe1a0ada9f..00000000000 --- a/packages/commonwealth/client/styles/components/component_kit/cw_component_showcase.scss +++ /dev/null @@ -1,276 +0,0 @@ -@import '../../shared'; - -@mixin gallery-grid($gap, $flex-direction) { - display: flex; - flex-direction: $flex-direction; - gap: $gap; - flex-wrap: wrap; -} - -$width: 360px; - -.ComponentShowcase { - @include gallery-grid(32px, column); - padding: 24px; - width: 100%; - - .modal-gallery { - @include gallery-grid(8px, row); - - margin-top: -32px; - } - - .basic-gallery { - @include gallery-grid(8px, column); - width: $width; - - .item-row { - align-items: center; - display: flex; - gap: 16px; - - .Icon { - color: $neutral-400; - } - } - - .upvote-popover-wrapper { - width: fit-content; - } - } - - .progress-gallery { - @include gallery-grid(8px, column); - width: 400px; - } - - .tooltip-gallery { - @include gallery-grid(8px, column); - - .tooltip-row { - align-items: center; - @include gallery-grid(initial, row); - justify-content: space-between; - width: 240px; - - .Icon { - color: $neutral-400; - } - } - } - - .upvote-gallery { - @include gallery-grid(8px, column); - - .upvote-row { - align-items: center; - @include gallery-grid(initial, row); - justify-content: space-between; - width: 180px; - } - } - - .thread-actions-gallery { - @include gallery-grid(8px, column); - } - - .text-gallery { - @include gallery-grid(initial, column); - - .text-row { - align-items: center; - @include gallery-grid(initial, row); - height: 48px; - justify-content: space-between; - width: 400px; - - .ellipsis-row { - display: flex; - width: 200px; - } - } - } - - .icon-gallery { - @include gallery-grid(initial, column); - width: 100%; - - .all-icons-container { - display: flex; - flex-flow: row; - flex-wrap: wrap; - margin-bottom: 16px; - width: fit-content; - - .icon-container { - align-items: flex-start; - @include gallery-grid(initial, column); - height: 40px; - justify-content: center; - margin: 8px; - width: 80px; - - .icon-name { - font-size: 10px; - margin-bottom: 4px; - } - } - } - - .icon-row { - align-items: center; - display: flex; - height: 32px; - justify-content: space-between; - width: 200px; - } - } - - .icon-button-gallery { - @include gallery-grid(8px, column); - - .icon-button-row { - align-items: center; - @include gallery-grid(initial, row); - height: 32px; - justify-content: space-between; - width: 120px; - } - } - - .button-gallery, - .circle-button-gallery { - @include gallery-grid(8px, column); - - .button-row { - align-items: center; - display: flex; - flex-wrap: wrap; - gap: 8px; - } - } - - .choice-gallery { - @include gallery-grid(8px, column); - } - - .card-gallery { - @include gallery-grid(8px, column); - width: 100%; - - .top-card-row { - @include gallery-grid(initial, row); - justify-content: space-between; - } - } - - .form-gallery { - @include gallery-grid(8px, column); - width: $width; - - .custom-width-1 { - width: 250px; - } - - .custom-width-2 { - width: 275px; - } - - .custom-width-3 { - width: 300px; - } - } - - .toggle-gallery { - @include gallery-grid(8px, row); - - .toggle-label { - display: grid; - align-items: center; - } - } - - .tag-gallery { - gap: 8px; - display: flex; - flex-direction: column; - - .tag-row { - display: flex; - flex-wrap: wrap; - gap: 8px; - margin-bottom: 15px; - - > .Text { - min-width: 140px; - } - } - } - - .editor-toggle { - display: flex; - align-items: center; - margin: 16px 0; - - .caption { - margin-left: 8px; - } - } - - .banners, - .alerts { - .container { - margin-top: 10px; - @include gallery-grid(8px, column); - } - } - - .tooltip { - @include gallery-grid(32px, column); - align-items: center; - } - - .searchbar-gallery { - @include gallery-grid(8px, column); - } - - .dropdowns { - .dropdown-type { - margin-bottom: 25px; - } - - .multi-select, - .typeahead { - .multi-select-row, - .typeahead-row { - margin-bottom: 15px; - } - } - } - - .table { - width: 100%; - } - - .new-tabs { - width: max(100%, 300px); - overflow-x: auto; - } - - .CommunitySelectorContainer { - display: flex; - flex-direction: column; - gap: 24px; - width: 100%; - } - - .FormStepContainer { - width: 100%; - } - - .community-stake-banner { - .btn-container { - margin-bottom: 15px; - } - } -} diff --git a/packages/commonwealth/client/styles/components/token_decimal_input.scss b/packages/commonwealth/client/styles/components/token_decimal_input.scss deleted file mode 100644 index 65a1d682c4f..00000000000 --- a/packages/commonwealth/client/styles/components/token_decimal_input.scss +++ /dev/null @@ -1,18 +0,0 @@ -@import '../shared'; - -.TokenDecimalInput { - display: flex; - flex-direction: column; - gap: 8px; - width: 100%; - - .token-settings { - align-items: center; - display: flex; - gap: 8px; - - .toggle-caption-text.Text { - color: $neutral-500; - } - } -} diff --git a/packages/commonwealth/client/styles/mixins/elevation.scss b/packages/commonwealth/client/styles/mixins/elevation.scss deleted file mode 100644 index bc4d819dca8..00000000000 --- a/packages/commonwealth/client/styles/mixins/elevation.scss +++ /dev/null @@ -1,9 +0,0 @@ -$elevation-1: 0px 1px 2px rgba(40, 39, 41, 0.05); -$elevation-2: 0px 1px 3px rgba(40, 39, 41, 0.1), - 0px 1px 2px rgba(40, 39, 41, 0.06); -$elevation-3: 0px 4px 8px -2px rgba(40, 39, 41, 0.1), - 0px 2px 4px -2px rgba(40, 39, 41, 0.06); -$elevation-4: 0px 12px 16px -4px rgba(40, 39, 41, 0.08), - 0px 4px 6px -2px rgba(40, 39, 41, 0.03); -$elevation-5: 0px 20px 24px -4px rgba(40, 39, 41, 0.08), - 0px 8px 8px -4px rgba(40, 39, 41, 0.03); \ No newline at end of file diff --git a/packages/commonwealth/client/styles/modals/edit_topic_thresholds_modal.scss b/packages/commonwealth/client/styles/modals/edit_topic_thresholds_modal.scss deleted file mode 100644 index e7bc8c7ca93..00000000000 --- a/packages/commonwealth/client/styles/modals/edit_topic_thresholds_modal.scss +++ /dev/null @@ -1,21 +0,0 @@ -@import '../shared'; - -.EditTopicThresholdsModal { - .EditTopicThresholdsBody { - display: flex; - flex-direction: column; - gap: 16px; - overflow-y: auto; - margin-bottom: 24px; - - .EditTopicThresholdsRow { - display: flex; - flex-direction: column; - - .input-and-button-row { - display: flex; - gap: 8px; - } - } - } -} diff --git a/packages/commonwealth/client/styles/modals/upgrade_member_modal.scss b/packages/commonwealth/client/styles/modals/upgrade_member_modal.scss deleted file mode 100644 index 34355a8f71e..00000000000 --- a/packages/commonwealth/client/styles/modals/upgrade_member_modal.scss +++ /dev/null @@ -1,19 +0,0 @@ -@import '../shared'; - -.UpgradeMemberModal { - .upgrade-member-button { - margin: 20px 0; - } - - .error-message { - margin: 10px 0; - font-weight: 500; - color: $rorange-500; - } - - .success-message { - margin: 10px 0; - font-weight: 500; - color: $green-500; - } -} diff --git a/packages/commonwealth/client/styles/pages/feed/index.scss b/packages/commonwealth/client/styles/pages/feed/index.scss deleted file mode 100644 index 6958a22180a..00000000000 --- a/packages/commonwealth/client/styles/pages/feed/index.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import '../../shared'; - -.FeedPage { - display: flex; - flex-direction: column; - height: 100%; -} diff --git a/packages/commonwealth/client/styles/pages/referenda.scss b/packages/commonwealth/client/styles/pages/referenda.scss deleted file mode 100644 index 7d33f213d6a..00000000000 --- a/packages/commonwealth/client/styles/pages/referenda.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import '../shared'; - -.ReferendaPage { - flex: 1; - padding: 24px; -} diff --git a/packages/commonwealth/client/styles/pages/tip_detail.scss b/packages/commonwealth/client/styles/pages/tip_detail.scss deleted file mode 100644 index b26355499fa..00000000000 --- a/packages/commonwealth/client/styles/pages/tip_detail.scss +++ /dev/null @@ -1,70 +0,0 @@ -@import '../shared'; - -.TipDetail { - display: flex; - flex: 1; - padding: 24px; - - .contribute { - margin-bottom: 64px; - } - - .title { - font-size: 32px; - font-weight: 500; - margin-bottom: 32px; - } - - .proposal-page-row { - margin-bottom: 18px; - } - - .tip-details { - width: 65%; - flex: 1 1 auto; - - .label { - font-weight: 600; - padding-bottom: 8px; - } - - .tip-reason { - width: 75%; - } - - .amount { - display: flex; - align-items: center; - } - } - - .tip-contributions { - width: 35%; - flex: 1 1 auto; - - .mb-12 { - margin-bottom: 12px; - } - - .label { - font-weight: 600; - } - - .contributors { - margin-bottom: 32px; - } - - .contributors-row { - display: flex; - margin-bottom: 18px; - overflow: hidden; - - .amount { - flex: 0 0 30%; - margin-right: 12px; - display: flex; - align-items: center; - } - } - } -} diff --git a/packages/commonwealth/client/styles/pages/tips.scss b/packages/commonwealth/client/styles/pages/tips.scss deleted file mode 100644 index 760cec8fa3c..00000000000 --- a/packages/commonwealth/client/styles/pages/tips.scss +++ /dev/null @@ -1,30 +0,0 @@ -@import '../shared'; - -.TipDetail { - display: flex; - flex-direction: column; - gap: 16px; - height: 100%; - justify-content: space-between; - width: 100%; - - .tip-detail-group { - display: flex; - flex-direction: column; - gap: 4px; - - .reason-header-text.Text { - color: $neutral-500; - } - - .reason-text.Text { - @include multiline-text-ellipsis(3); - word-break: break-word; - } - } -} - -.TipsPage { - flex: 1; - padding: 24px; -} diff --git a/packages/commonwealth/client/styles/pages/treasury.scss b/packages/commonwealth/client/styles/pages/treasury.scss deleted file mode 100644 index 48a19d0f0b0..00000000000 --- a/packages/commonwealth/client/styles/pages/treasury.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import '../shared'; - -.TreasuryPage { - flex: 1; - padding: 24px; -} diff --git a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_chain_event_row.scss b/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_chain_event_row.scss deleted file mode 100644 index 24e81f4b7d1..00000000000 --- a/packages/commonwealth/client/styles/pages/user_dashboard/user_dashboard_chain_event_row.scss +++ /dev/null @@ -1,79 +0,0 @@ -@import '../../shared'; -@import 'user_dashboard_row.scss'; - -.UserDashboardChainEventRow { - @include userDashboardRowStyles; - gap: 24px; - width: 100%; - color: unset !important; - text-decoration: none; - - a { - color: unset !important; - - &:hover, - &:focus, - &:active { - color: unset !important; - } - } - - &:hover, - &:focus, - &:active { - color: unset !important; - text-decoration: none; - } - - &.isLink { - cursor: pointer; - } - - .chain-event-icon-container { - display: flex; - align-items: center; - - .delegate { - fill: $white; - } - } - - .chain-event-text-container { - display: flex; - flex-direction: column; - gap: 8px; - word-break: break-word; - - .community-title { - display: flex; - align-items: center; - - .CommunityAvatar { - margin-right: 4px; - } - - .dot { - width: 24px; - height: 16px; - color: $neutral-500; - display: flex; - align-items: center; - justify-content: center; - font-weight: 600; - padding-bottom: 8px; - } - - .block { - color: $neutral-500; - } - } - - .row-top-text.Text { - @include rowTopTextStyles; - } - - .label { - color: $neutral-600; - } - } -} \ No newline at end of file diff --git a/packages/commonwealth/client/styles/pages/view_proposal/linked_proposals_embed.scss b/packages/commonwealth/client/styles/pages/view_proposal/linked_proposals_embed.scss deleted file mode 100644 index 4203ac68c87..00000000000 --- a/packages/commonwealth/client/styles/pages/view_proposal/linked_proposals_embed.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import '../../shared'; - -.LinkedProposalsEmbed { - align-items: center; - background-color: $neutral-100; - border-radius: $border-radius-corners; - display: flex; - flex-direction: column; - gap: 8px; - padding: 16px; -} diff --git a/packages/commonwealth/client/vite.config.ts b/packages/commonwealth/client/vite.config.ts index a1e70edd741..472f2019786 100644 --- a/packages/commonwealth/client/vite.config.ts +++ b/packages/commonwealth/client/vite.config.ts @@ -46,6 +46,7 @@ export default defineConfig(({ mode }) => { 'process.env.FLAG_MANAGE_API_KEYS': JSON.stringify( env.FLAG_MANAGE_API_KEYS, ), + 'process.env.FLAG_REFERRALS': JSON.stringify(env.FLAG_REFERRALS), }; const config = { diff --git a/packages/commonwealth/package.json b/packages/commonwealth/package.json index c508940dbe4..c4ff0476173 100644 --- a/packages/commonwealth/package.json +++ b/packages/commonwealth/package.json @@ -219,6 +219,7 @@ "node-jose": "^2.2.0", "node-object-hash": "^3.0.0", "numeral": "^2.0.6", + "octokit": "^4.0.2", "openai": "^4.0.0", "os-browserify": "^0.3.0", "parchment": "^1.1.4", @@ -286,7 +287,6 @@ "devDependencies": { "@ethersproject/keccak256": "5.7.0", "@types/express": "^4.17.21", - "@types/moment": "^2.13.0", "@types/passport": "^1.0.16", "@types/passport-auth-token": "^1.0.4", "@types/sinon": "^17.0.3", diff --git a/packages/commonwealth/server/api/user.ts b/packages/commonwealth/server/api/user.ts index 77a11c66ddf..eafa47b6921 100644 --- a/packages/commonwealth/server/api/user.ts +++ b/packages/commonwealth/server/api/user.ts @@ -10,4 +10,7 @@ export const trpcRouter = trpc.router({ getUserProfile: trpc.query(User.GetUserProfile, trpc.Tag.User), getUserAddresses: trpc.query(User.GetUserAddresses, trpc.Tag.User), searchUserProfiles: trpc.query(User.SearchUserProfiles, trpc.Tag.User), + createReferralLink: trpc.command(User.CreateReferralLink, trpc.Tag.User), + getReferralLink: trpc.query(User.GetReferralLink, trpc.Tag.User), + getUserReferrals: trpc.query(User.GetUserReferrals, trpc.Tag.User), }); diff --git a/packages/commonwealth/server/config.ts b/packages/commonwealth/server/config.ts index 57baac973f4..71de7fae3a3 100644 --- a/packages/commonwealth/server/config.ts +++ b/packages/commonwealth/server/config.ts @@ -23,7 +23,8 @@ const { CF_ZONE_ID, CF_API_KEY, LIBP2P_PRIVATE_KEY, - API_CLIENT_REPO_TOKEN, + DISPATCHER_APP_ID, + DISPATCHER_APP_PRIVATE_KEY, } = process.env; const NO_PRERENDER = _NO_PRERENDER; @@ -99,7 +100,10 @@ export const config = configure( LIBP2P_PRIVATE_KEY, SNAPSHOT_WEBHOOK_SECRET, GITHUB: { - API_CLIENT_REPO_TOKEN, + DISPATCHER_APP_ID: DISPATCHER_APP_ID + ? parseInt(DISPATCHER_APP_ID) + : undefined, + DISPATCHER_APP_PRIVATE_KEY, }, }, z.object({ @@ -170,12 +174,17 @@ export const config = configure( 'SNAPSHOT_WEBHOOK_SECRET is required in public environments', ), GITHUB: z.object({ - API_CLIENT_REPO_TOKEN: z + DISPATCHER_APP_ID: z + .number() + .optional() + .refine((data) => !(model_config.APP_ENV === 'production' && !data)) + .describe('The ID of the Common Workflow Dispatcher GitHub app'), + DISPATCHER_APP_PRIVATE_KEY: z .string() .optional() .refine((data) => !(model_config.APP_ENV === 'production' && !data)) .describe( - 'A token used to authenticate with the GitHub API. Primarily used to trigger workflows', + 'The private key of the Common Workflow Dispatcher GitHub app', ), }), }), diff --git a/packages/commonwealth/server/migrations/20241201172845-add_tag_desci.js b/packages/commonwealth/server/migrations/20241201172845-add_tag_desci.js new file mode 100644 index 00000000000..58a1f146a3b --- /dev/null +++ b/packages/commonwealth/server/migrations/20241201172845-add_tag_desci.js @@ -0,0 +1,31 @@ +'use strict'; + +/** @type {import('sequelize-cli').Migration} */ +module.exports = { + up: async (queryInterface, Sequelize) => { + return queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.sequelize.query( + ` + INSERT INTO public."Tags" + (name, created_at, updated_at) + values + ('DeSci', now(), now()) + `, + { transaction }, + ); + }); + }, + + async down(queryInterface, Sequelize) { + return queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.sequelize.query( + ` + DELETE FROM public."Tags" + WHERE name IN + ('DeSci') + `, + { transaction }, + ); + }); + }, +}; diff --git a/packages/commonwealth/server/util/dispatchSDKPublishWorkflow.ts b/packages/commonwealth/server/util/dispatchSDKPublishWorkflow.ts index d9ad07bd95d..bbbde21f422 100644 --- a/packages/commonwealth/server/util/dispatchSDKPublishWorkflow.ts +++ b/packages/commonwealth/server/util/dispatchSDKPublishWorkflow.ts @@ -1,6 +1,7 @@ import { logger } from '@hicommonwealth/core'; import { readFileSync } from 'fs'; import fetch from 'node-fetch'; +import { App } from 'octokit'; import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; import { config } from '../config'; @@ -12,11 +13,33 @@ const externalApiConfig = JSON.parse( readFileSync(path.join(__dirname, '../external-api-config.json'), 'utf8'), ); -const API_CLIENT_GH_ORG = 'hicommonwealth'; -const API_CLIENT_GH_REPO = 'api-client'; -const API_CLIENT_PUBLISH_WORKFLOW_FILE_NAME = 'publish.yml'; +const owner = 'hicommonwealth'; +const repo = 'common-api-fern-config'; +const workflow_id = 'publish.yml'; const API_CLIENT_NPM_NAME = '@commonxyz/api-client'; +export async function getOctokit() { + if ( + !config.GITHUB.DISPATCHER_APP_ID || + !config.GITHUB.DISPATCHER_APP_PRIVATE_KEY + ) { + log.error('Missing GitHub app credentials'); + return; + } + const app = new App({ + appId: config.GITHUB.DISPATCHER_APP_ID, + privateKey: config.GITHUB.DISPATCHER_APP_PRIVATE_KEY, + }); + + // https://docs.github.com/en/rest/apps/apps?#get-a-repository-installation-for-the-authenticated-app + const { data: installation } = await app.octokit.request( + `GET /repos/{owner}/{repo}/installation`, + { owner, repo }, + ); + + return app.getInstallationOctokit(installation.id); +} + export async function dispatchSDKPublishWorkflow() { let currentVersionNPM: string | undefined = undefined; @@ -50,33 +73,26 @@ export async function dispatchSDKPublishWorkflow() { return; } - const url = - `https://api.github.com/repos/${API_CLIENT_GH_ORG}/${API_CLIENT_GH_REPO}` + - `/actions/workflows/${API_CLIENT_PUBLISH_WORKFLOW_FILE_NAME}/dispatches`; - - const data = { - ref: 'main', - inputs: { - version: externalApiConfig.version, - }, - }; + const url = `/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`; try { - const response = await fetch(url, { - method: 'POST', + const octokit = await getOctokit(); + if (!octokit) return; + const res = await octokit.request(`POST ${url}`, { + owner, + repo, + workflow_id, + ref: 'main', + inputs: { + version: externalApiConfig.version, + }, headers: { - Accept: 'application/vnd.github+json', - Authorization: `Bearer ${config.GITHUB.API_CLIENT_REPO_TOKEN}`, 'X-GitHub-Api-Version': '2022-11-28', - 'Content-Type': 'application/json', }, - body: JSON.stringify(data), }); - if (response.status !== 204) { - log.fatal( - `Failed to dispatch workflow: ${response.status} - ${response.statusText}`, - ); + if (res.status !== 204) { + log.fatal(`Failed to dispatch workflow: ${res.status}`); } else { log.info('Workflow dispatched successfully'); } diff --git a/packages/commonwealth/shared/analytics/types.ts b/packages/commonwealth/shared/analytics/types.ts index f2ac69fb7da..81ed7e3ab7e 100644 --- a/packages/commonwealth/shared/analytics/types.ts +++ b/packages/commonwealth/shared/analytics/types.ts @@ -8,6 +8,7 @@ export const enum MixpanelPageViewEvent { GROUPS_CREATION_PAGE_VIEW = 'Create Group Page Viewed', GROUPS_EDIT_PAGE_VIEW = 'Edit Group Page Viewed', DIRECTORY_PAGE_VIEW = 'Directory Page Viewed', + LEADERBOARD_PAGE_VIEW = 'Leaderboard Page Viewed', } export const enum MixpanelCommunityInteractionEvent { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aaf7641448e..c4e7a652f58 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,9 +96,6 @@ importers: '@types/marked': specifier: ^4.0.1 version: 4.3.2 - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 '@types/morgan': specifier: ^1.9.4 version: 1.9.9 @@ -446,9 +443,6 @@ importers: specifier: ^6.1.13 version: 6.11.4 devDependencies: - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 tsx: specifier: ^4.7.2 version: 4.9.3 @@ -498,9 +492,6 @@ importers: specifier: ^3.22.4 version: 3.23.6 devDependencies: - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 '@types/sinon': specifier: ^17.0.3 version: 17.0.3 @@ -701,9 +692,6 @@ importers: specifier: ^3.22.4 version: 3.23.6 devDependencies: - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 '@types/node': specifier: ^20.11.25 version: 20.12.10 @@ -731,10 +719,6 @@ importers: zod: specifier: ^3.22.4 version: 3.23.6 - devDependencies: - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 libs/shared: dependencies: @@ -792,10 +776,6 @@ importers: safe-stable-stringify: specifier: ^2.4.2 version: 2.4.3 - devDependencies: - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 libs/sitemaps: dependencies: @@ -1249,6 +1229,9 @@ importers: numeral: specifier: ^2.0.6 version: 2.0.6 + octokit: + specifier: ^4.0.2 + version: 4.0.2 openai: specifier: ^4.0.0 version: 4.42.0 @@ -1445,9 +1428,6 @@ importers: '@types/express': specifier: ^4.17.21 version: 4.17.21 - '@types/moment': - specifier: ^2.13.0 - version: 2.13.0 '@types/passport': specifier: ^1.0.16 version: 1.0.16 @@ -5006,6 +4986,113 @@ packages: engines: {node: '>=8.0.0', npm: '>=5.0.0'} hasBin: true + '@octokit/app@15.1.0': + resolution: {integrity: sha512-TkBr7QgOmE6ORxvIAhDbZsqPkF7RSqTY4pLTtUQCvr6dTXqvi2fFo46q3h1lxlk/sGMQjqyZ0kEahkD/NyzOHg==} + engines: {node: '>= 18'} + + '@octokit/auth-app@7.1.3': + resolution: {integrity: sha512-GZdkOp2kZTIy5dG9oXqvzUAZiPvDx4C/lMlN6yQjtG9d/+hYa7W8WXTJoOrXE8UdfL9A/sZMl206dmtkl9lwVQ==} + engines: {node: '>= 18'} + + '@octokit/auth-oauth-app@8.1.1': + resolution: {integrity: sha512-5UtmxXAvU2wfcHIPPDWzVSAWXVJzG3NWsxb7zCFplCWEmMCArSZV0UQu5jw5goLQXbFyOr5onzEH37UJB3zQQg==} + engines: {node: '>= 18'} + + '@octokit/auth-oauth-device@7.1.1': + resolution: {integrity: sha512-HWl8lYueHonuyjrKKIup/1tiy0xcmQCdq5ikvMO1YwkNNkxb6DXfrPjrMYItNLyCP/o2H87WuijuE+SlBTT8eg==} + engines: {node: '>= 18'} + + '@octokit/auth-oauth-user@5.1.1': + resolution: {integrity: sha512-rRkMz0ErOppdvEfnemHJXgZ9vTPhBuC6yASeFaB7I2yLMd7QpjfrL1mnvRPlyKo+M6eeLxrKanXJ9Qte29SRsw==} + engines: {node: '>= 18'} + + '@octokit/auth-token@5.1.1': + resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} + engines: {node: '>= 18'} + + '@octokit/auth-unauthenticated@6.1.0': + resolution: {integrity: sha512-zPSmfrUAcspZH/lOFQnVnvjQZsIvmfApQH6GzJrkIunDooU1Su2qt2FfMTSVPRp7WLTQyC20Kd55lF+mIYaohQ==} + engines: {node: '>= 18'} + + '@octokit/core@6.1.2': + resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} + engines: {node: '>= 18'} + + '@octokit/endpoint@10.1.1': + resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==} + engines: {node: '>= 18'} + + '@octokit/graphql@8.1.1': + resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} + engines: {node: '>= 18'} + + '@octokit/oauth-app@7.1.3': + resolution: {integrity: sha512-EHXbOpBkSGVVGF1W+NLMmsnSsJRkcrnVmDKt0TQYRBb6xWfWzoi9sBD4DIqZ8jGhOWO/V8t4fqFyJ4vDQDn9bg==} + engines: {node: '>= 18'} + + '@octokit/oauth-authorization-url@7.1.1': + resolution: {integrity: sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA==} + engines: {node: '>= 18'} + + '@octokit/oauth-methods@5.1.2': + resolution: {integrity: sha512-C5lglRD+sBlbrhCUTxgJAFjWgJlmTx5bQ7Ch0+2uqRjYv7Cfb5xpX4WuSC9UgQna3sqRGBL9EImX9PvTpMaQ7g==} + engines: {node: '>= 18'} + + '@octokit/openapi-types@22.2.0': + resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} + + '@octokit/openapi-webhooks-types@8.3.0': + resolution: {integrity: sha512-vKLsoR4xQxg4Z+6rU/F65ItTUz/EXbD+j/d4mlq2GW8TsA4Tc8Kdma2JTAAJ5hrKWUQzkR/Esn2fjsqiVRYaQg==} + + '@octokit/plugin-paginate-graphql@5.2.4': + resolution: {integrity: sha512-pLZES1jWaOynXKHOqdnwZ5ULeVR6tVVCMm+AUbp0htdcyXDU95WbkYdU4R2ej1wKj5Tu94Mee2Ne0PjPO9cCyA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + + '@octokit/plugin-paginate-rest@11.3.5': + resolution: {integrity: sha512-cgwIRtKrpwhLoBi0CUNuY83DPGRMaWVjqVI/bGKsLJ4PzyWZNaEmhHroI2xlrVXkk6nFv0IsZpOp+ZWSWUS2AQ==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + + '@octokit/plugin-rest-endpoint-methods@13.2.6': + resolution: {integrity: sha512-wMsdyHMjSfKjGINkdGKki06VEkgdEldIGstIEyGX0wbYHGByOwN/KiM+hAAlUwAtPkP3gvXtVQA9L3ITdV2tVw==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + + '@octokit/plugin-retry@7.1.2': + resolution: {integrity: sha512-XOWnPpH2kJ5VTwozsxGurw+svB2e61aWlmk5EVIYZPwFK5F9h4cyPyj9CIKRyMXMHSwpIsI3mPOdpMmrRhe7UQ==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + + '@octokit/plugin-throttling@9.3.2': + resolution: {integrity: sha512-FqpvcTpIWFpMMwIeSoypoJXysSAQ3R+ALJhXXSG1HTP3YZOIeLmcNcimKaXxTcws+Sh6yoRl13SJ5r8sXc1Fhw==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': ^6.0.0 + + '@octokit/request-error@6.1.5': + resolution: {integrity: sha512-IlBTfGX8Yn/oFPMwSfvugfncK2EwRLjzbrpifNaMY8o/HTEAFqCA1FZxjD9cWvSKBHgrIhc4CSBIzMxiLsbzFQ==} + engines: {node: '>= 18'} + + '@octokit/request@9.1.3': + resolution: {integrity: sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==} + engines: {node: '>= 18'} + + '@octokit/types@13.6.1': + resolution: {integrity: sha512-PHZE9Z+kWXb23Ndik8MKPirBPziOc0D2/3KH1P+6jK5nGWe96kadZuE4jev2/Jq7FvIfTlT2Ltg8Fv2x1v0a5g==} + + '@octokit/webhooks-methods@5.1.0': + resolution: {integrity: sha512-yFZa3UH11VIxYnnoOYCVoJ3q4ChuSOk2IVBBQ0O3xtKX4x9bmKb/1t+Mxixv2iUhzMdOl1qeWJqEhouXXzB3rQ==} + engines: {node: '>= 18'} + + '@octokit/webhooks@13.3.0': + resolution: {integrity: sha512-TUkJLtI163Bz5+JK0O+zDkQpn4gKwN+BovclUvCj6pI/6RXrFqQvUMRS2M+Rt8Rv0qR3wjoMoOPmpJKeOh0nBg==} + engines: {node: '>= 18'} + '@one-ini/wasm@0.1.1': resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} @@ -7184,6 +7271,9 @@ packages: '@types/argparse@1.0.38': resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} + '@types/aws-lambda@8.10.145': + resolution: {integrity: sha512-dtByW6WiFk5W5Jfgz1VM+YPA21xMXTuSFoLYIDY0L44jDLLflVPtZkYuu3/YxpGcvjzKFBZLU+GyKjR0HOYtyw==} + '@types/better-sqlite3@7.6.11': resolution: {integrity: sha512-i8KcD3PgGtGBLl3+mMYA8PdKkButvPyARxA7IQAd6qeslht13qxb1zzO8dRCtE7U3IoJS782zDBAeoKiM695kg==} @@ -7320,10 +7410,6 @@ packages: '@types/minimist@1.2.5': resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} - '@types/moment@2.13.0': - resolution: {integrity: sha512-DyuyYGpV6r+4Z1bUznLi/Y7HpGn4iQ4IVcGn8zrr1P4KotKLdH0sbK1TFR6RGyX6B+G8u83wCzL+bpawKU/hdQ==} - deprecated: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed! - '@types/morgan@1.9.9': resolution: {integrity: sha512-iRYSDKVaC6FkGSpEVVIvrRGw0DfJMiQzIn3qr2G5B3C//AWkulhXgaBd7tS9/J79GWSYMTHGs7PfI5b3Y8m+RQ==} @@ -8371,6 +8457,9 @@ packages: bech32@2.0.0: resolution: {integrity: sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==} + before-after-hook@3.0.2: + resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} + better-sqlite3@11.1.2: resolution: {integrity: sha512-gujtFwavWU4MSPT+h9B+4pkvZdyOUkH54zgLdIrMmmmd4ZqiBIrRNBzNzYVFO417xo882uP5HBu4GjOfaSrIQw==} @@ -8450,6 +8539,9 @@ packages: borsh@0.7.0: resolution: {integrity: sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==} + bottleneck@2.19.5: + resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} + bowser@2.11.0: resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} @@ -12957,6 +13049,10 @@ packages: obuf@1.1.2: resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + octokit@4.0.2: + resolution: {integrity: sha512-wbqF4uc1YbcldtiBFfkSnquHtECEIpYD78YUXI6ri1Im5OO2NLo6ZVpRdbJpdnpZ05zMrVPssNiEo6JQtea+Qg==} + engines: {node: '>= 18'} + ofetch@1.3.4: resolution: {integrity: sha512-KLIET85ik3vhEfS+3fDlc/BAZiAp+43QEC/yCo5zkNoY2YaKvNkOaFr/6wCFgFH1kuYQM5pMNi0Tg8koiIemtw==} @@ -15376,6 +15472,10 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + toad-cache@3.7.0: + resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} + engines: {node: '>=12'} + toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -15747,6 +15847,12 @@ packages: unist-util-visit@5.0.0: resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + universal-github-app-jwt@2.2.0: + resolution: {integrity: sha512-G5o6f95b5BggDGuUfKDApKaCgNYy2x7OdHY0zSMF081O0EJobw+1130VONhrA7ezGSV2FNOGyM+KQpQZAr9bIQ==} + + universal-user-agent@7.0.2: + resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -23075,6 +23181,152 @@ snapshots: transitivePeerDependencies: - encoding + '@octokit/app@15.1.0': + dependencies: + '@octokit/auth-app': 7.1.3 + '@octokit/auth-unauthenticated': 6.1.0 + '@octokit/core': 6.1.2 + '@octokit/oauth-app': 7.1.3 + '@octokit/plugin-paginate-rest': 11.3.5(@octokit/core@6.1.2) + '@octokit/types': 13.6.1 + '@octokit/webhooks': 13.3.0 + + '@octokit/auth-app@7.1.3': + dependencies: + '@octokit/auth-oauth-app': 8.1.1 + '@octokit/auth-oauth-user': 5.1.1 + '@octokit/request': 9.1.3 + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + toad-cache: 3.7.0 + universal-github-app-jwt: 2.2.0 + universal-user-agent: 7.0.2 + + '@octokit/auth-oauth-app@8.1.1': + dependencies: + '@octokit/auth-oauth-device': 7.1.1 + '@octokit/auth-oauth-user': 5.1.1 + '@octokit/request': 9.1.3 + '@octokit/types': 13.6.1 + universal-user-agent: 7.0.2 + + '@octokit/auth-oauth-device@7.1.1': + dependencies: + '@octokit/oauth-methods': 5.1.2 + '@octokit/request': 9.1.3 + '@octokit/types': 13.6.1 + universal-user-agent: 7.0.2 + + '@octokit/auth-oauth-user@5.1.1': + dependencies: + '@octokit/auth-oauth-device': 7.1.1 + '@octokit/oauth-methods': 5.1.2 + '@octokit/request': 9.1.3 + '@octokit/types': 13.6.1 + universal-user-agent: 7.0.2 + + '@octokit/auth-token@5.1.1': {} + + '@octokit/auth-unauthenticated@6.1.0': + dependencies: + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + + '@octokit/core@6.1.2': + dependencies: + '@octokit/auth-token': 5.1.1 + '@octokit/graphql': 8.1.1 + '@octokit/request': 9.1.3 + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + before-after-hook: 3.0.2 + universal-user-agent: 7.0.2 + + '@octokit/endpoint@10.1.1': + dependencies: + '@octokit/types': 13.6.1 + universal-user-agent: 7.0.2 + + '@octokit/graphql@8.1.1': + dependencies: + '@octokit/request': 9.1.3 + '@octokit/types': 13.6.1 + universal-user-agent: 7.0.2 + + '@octokit/oauth-app@7.1.3': + dependencies: + '@octokit/auth-oauth-app': 8.1.1 + '@octokit/auth-oauth-user': 5.1.1 + '@octokit/auth-unauthenticated': 6.1.0 + '@octokit/core': 6.1.2 + '@octokit/oauth-authorization-url': 7.1.1 + '@octokit/oauth-methods': 5.1.2 + '@types/aws-lambda': 8.10.145 + universal-user-agent: 7.0.2 + + '@octokit/oauth-authorization-url@7.1.1': {} + + '@octokit/oauth-methods@5.1.2': + dependencies: + '@octokit/oauth-authorization-url': 7.1.1 + '@octokit/request': 9.1.3 + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + + '@octokit/openapi-types@22.2.0': {} + + '@octokit/openapi-webhooks-types@8.3.0': {} + + '@octokit/plugin-paginate-graphql@5.2.4(@octokit/core@6.1.2)': + dependencies: + '@octokit/core': 6.1.2 + + '@octokit/plugin-paginate-rest@11.3.5(@octokit/core@6.1.2)': + dependencies: + '@octokit/core': 6.1.2 + '@octokit/types': 13.6.1 + + '@octokit/plugin-rest-endpoint-methods@13.2.6(@octokit/core@6.1.2)': + dependencies: + '@octokit/core': 6.1.2 + '@octokit/types': 13.6.1 + + '@octokit/plugin-retry@7.1.2(@octokit/core@6.1.2)': + dependencies: + '@octokit/core': 6.1.2 + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + bottleneck: 2.19.5 + + '@octokit/plugin-throttling@9.3.2(@octokit/core@6.1.2)': + dependencies: + '@octokit/core': 6.1.2 + '@octokit/types': 13.6.1 + bottleneck: 2.19.5 + + '@octokit/request-error@6.1.5': + dependencies: + '@octokit/types': 13.6.1 + + '@octokit/request@9.1.3': + dependencies: + '@octokit/endpoint': 10.1.1 + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + universal-user-agent: 7.0.2 + + '@octokit/types@13.6.1': + dependencies: + '@octokit/openapi-types': 22.2.0 + + '@octokit/webhooks-methods@5.1.0': {} + + '@octokit/webhooks@13.3.0': + dependencies: + '@octokit/openapi-webhooks-types': 8.3.0 + '@octokit/request-error': 6.1.5 + '@octokit/webhooks-methods': 5.1.0 + '@one-ini/wasm@0.1.1': {} '@open-draft/deferred-promise@2.2.0': {} @@ -26201,6 +26453,8 @@ snapshots: '@types/argparse@1.0.38': {} + '@types/aws-lambda@8.10.145': {} + '@types/better-sqlite3@7.6.11': dependencies: '@types/node': 20.12.10 @@ -26350,10 +26604,6 @@ snapshots: '@types/minimist@1.2.5': {} - '@types/moment@2.13.0': - dependencies: - moment: 2.30.1 - '@types/morgan@1.9.9': dependencies: '@types/node': 20.12.10 @@ -28491,6 +28741,8 @@ snapshots: bech32@2.0.0: {} + before-after-hook@3.0.2: {} + better-sqlite3@11.1.2: dependencies: bindings: 1.5.0 @@ -28598,6 +28850,8 @@ snapshots: bs58: 4.0.1 text-encoding-utf-8: 1.0.2 + bottleneck@2.19.5: {} + bowser@2.11.0: {} brace-expansion@1.1.11: @@ -34708,6 +34962,19 @@ snapshots: obuf@1.1.2: {} + octokit@4.0.2: + dependencies: + '@octokit/app': 15.1.0 + '@octokit/core': 6.1.2 + '@octokit/oauth-app': 7.1.3 + '@octokit/plugin-paginate-graphql': 5.2.4(@octokit/core@6.1.2) + '@octokit/plugin-paginate-rest': 11.3.5(@octokit/core@6.1.2) + '@octokit/plugin-rest-endpoint-methods': 13.2.6(@octokit/core@6.1.2) + '@octokit/plugin-retry': 7.1.2(@octokit/core@6.1.2) + '@octokit/plugin-throttling': 9.3.2(@octokit/core@6.1.2) + '@octokit/request-error': 6.1.5 + '@octokit/types': 13.6.1 + ofetch@1.3.4: dependencies: destr: 2.0.3 @@ -37685,6 +37952,8 @@ snapshots: dependencies: is-number: 7.0.0 + toad-cache@3.7.0: {} + toidentifier@1.0.1: {} toposort-class@1.0.1: {} @@ -38079,6 +38348,10 @@ snapshots: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 + universal-github-app-jwt@2.2.0: {} + + universal-user-agent@7.0.2: {} + universalify@0.1.2: {} universalify@0.2.0: {} diff --git a/vite.config.ts b/vite.config.ts index 7097748096a..26da8b5e827 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,5 @@ /// import * as dotenv from 'dotenv'; -import path from 'path'; import { defineConfig } from 'vite'; import tsconfigPaths from 'vite-tsconfig-paths'; @@ -9,17 +8,22 @@ dotenv.config(); export default defineConfig({ plugins: [tsconfigPaths()], test: { - setupFiles: [path.resolve(__dirname, './libs/model/src/vitest.setup.ts')], - poolMatchGlobs: [ - // lifecycle tests in forks pool (uses node:child_process) - ['**/libs/model/**/*-lifecycle.spec.ts', 'forks'], - // everything else runs in threads pool - ], - poolOptions: { - threads: { minThreads: 1, maxThreads: 1 }, - forks: { minForks: 1, maxForks: 5 }, - }, - fileParallelism: process.env.npm_package_name === '@hicommonwealth/model', + // Enables parallel lifecycle tests + // setupFiles: [path.resolve(__dirname, './libs/model/src/vitest.setup.ts')], + // poolMatchGlobs: [ + // // lifecycle tests in forks pool (uses node:child_process) + // ['**/libs/model/**/*-lifecycle.spec.ts', 'forks'], + // // everything else runs in threads pool + // ], + // poolOptions: { + // threads: { minThreads: 1, maxThreads: 1 }, + // forks: { minForks: 1, maxForks: 5 }, + // }, + // fileParallelism: process.env.npm_package_name === '@hicommonwealth/model', + + // Disables parallel lifecycle tests + fileParallelism: false, + sequence: { concurrent: false }, coverage: { include: ['src/**/*.ts'],