Skip to content

Commit

Permalink
style: dropdown changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrasinskis committed Mar 27, 2024
1 parent 83427c8 commit 772e1e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import Title from "$lib/components/header/Title.svelte";
import SelectUniverseNav from "$lib/components/universe/SelectUniverseNav.svelte";
import HeaderToolbar from "$lib/components/header/HeaderToolbar.svelte";
import { ENABLE_VOTING_INDICATION } from "$lib/stores/feature-flags.store";
</script>

<SplitContent>
<SplitContent perceivedOnMobile={!$ENABLE_VOTING_INDICATION}>
<SelectUniverseNav slot="start" />

<Title slot="title" />
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/lib/components/universe/SelectUniverseCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
$: actionableProposalSupported = $ENABLE_VOTING_INDICATION
? $actionableProposalSupportedStore[universe.canisterId]
: undefined;
let compactView = false;
$: compactView = $ENABLE_VOTING_INDICATION;
</script>

<Card
Expand All @@ -60,8 +63,9 @@
{icon}
testId="select-universe-card"
noPadding
noMarginBottom
>
<div class="container" class:selected>
<div class="container" class:selected class:compactView>
<UniverseLogo size="big" {universe} framed={true} />

<div
Expand Down Expand Up @@ -97,6 +101,13 @@
// Same as Card padding
// We want to padding in the container to use the hover effect on ALL the card surface.
padding: calc(var(--padding-2x) - var(--card-border-size));
&.compactView {
padding: calc(var(--padding) - var(--card-border-size));
@include media.min-width(large) {
padding: calc(var(--padding-2x) - var(--card-border-size));
}
}
--value-color: var(--text-color);
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/lib/components/universe/SelectUniverseNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
let innerWidth = 0;
let list = false;
$: list = innerWidth > BREAKPOINT_LARGE;
let largeScreen = false;
$: largeScreen = innerWidth > BREAKPOINT_LARGE;
$: list = largeScreen;
$: if (
$ENABLE_VOTING_INDICATION &&
$actionableProposalIndicationEnabledStore
Expand All @@ -27,11 +29,14 @@
) {
loadActionableSnsProposals();
}
let hideTitle = false;
$: hideTitle = $ENABLE_VOTING_INDICATION && !largeScreen;
</script>

<svelte:window bind:innerWidth />

<Nav>
<Nav {hideTitle}>
<p class="title" slot="title" data-tid="select-universe-nav-title">
{$titleTokenSelectorStore}
</p>
Expand Down

0 comments on commit 772e1e4

Please sign in to comment.