Skip to content

Commit

Permalink
small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Stoyan Delev committed Jul 25, 2022
1 parent 5471e89 commit 6136de8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 54 deletions.
1 change: 1 addition & 0 deletions components/cover/cover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const moreMenu = (

const StyledCover = styled.div<{ url: string }>`
background-size: cover;
background-position: center;
${(props) =>
getOverlayCssFromTheme(
(value) => ({ backgroundImage: ` ${value}, url(${props.url})` }),
Expand Down
6 changes: 5 additions & 1 deletion components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
IndeterminateProgressIndicator,
IconFilledMenu,
Drawer,
Hidden,
} from "newskit";
import Link from "next/link";
import { HideMobile, HideDesktop } from "../hide";
Expand Down Expand Up @@ -213,7 +214,10 @@ const UserSettings = ({ themeOnChange, themeName }: HeaderProps) => {
>
<HideMobile>
<Switch
label="Toggle theme"
label={
// @ts-ignore
<Hidden md>Toggle theme</Hidden>
}
onChange={themeOnChange}
checked={themeName === "light"}
overrides={{
Expand Down
7 changes: 4 additions & 3 deletions components/search-modal/search-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
GridLayout,
IconFilledSearch,
} from "newskit";
import Link from "next/link";
import React from "react";

import axios from "axios";
Expand Down Expand Up @@ -84,9 +85,9 @@ export const SearchModal = ({
</form>
<Menu vertical overrides={{ spaceInline: "space000" }}>
{searchResults.map(({ id, name }) => (
<MenuItem key={id} href={`/?id=${id}`}>
{name}
</MenuItem>
<Link key={id} href={`/?id=${id}`}>
<MenuItem href={`/?id=${id}`}>{name}</MenuItem>
</Link>
))}
</Menu>
</Modal>
Expand Down
18 changes: 5 additions & 13 deletions pages/album.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { NextPage, NextPageContext } from "next";
import { GridLayout, Slider, TextBlock } from "newskit";
import { GridLayout, InlineMessage, Slider, TextBlock } from "newskit";
import { Cover } from "../components/cover";
import { Songs } from "../components/songs";
import { CardList } from "../components/card-list";
import { Section } from "../components/section";
import axios from "axios";
import DeezerClient from "../services/deezer";
Expand Down Expand Up @@ -61,18 +60,11 @@ const Album: NextPage<Props> = ({
return (
<GridLayout rowGap="space100">
<Cover {...info} />
<Section title="Songs">
{songs.length ? (
{songs.length > 0 && (
<Section title="Songs">
<Songs songs={songs} />
) : (
<TextBlock
stylePreset="inkBase"
typographyPreset="editorialHeadline020"
>
No songs
</TextBlock>
)}
</Section>
</Section>
)}
</GridLayout>
);
};
Expand Down
49 changes: 15 additions & 34 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NextPage, NextPageContext } from "next";
import { GridLayout, Slider, TextBlock } from "newskit";
import { GridLayout, TextBlock, InlineMessage } from "newskit";
import { Cover } from "../components/cover";
import { Songs } from "../components/songs";
import { CardList } from "../components/card-list";
Expand Down Expand Up @@ -100,42 +100,23 @@ const Home: NextPage<Props> = ({
return (
<GridLayout rowGap="space100">
<Cover {...info} />
<Section title="Songs">
{topSongs.length ? (
{topSongs.length > 0 && (
<Section title="Songs">
<Songs songs={topSongs} />
) : (
<TextBlock
stylePreset="inkBase"
typographyPreset="editorialHeadline020"
>
No songs
</TextBlock>
)}
</Section>
<Section title="Albums">
{albums.length ? (
</Section>
)}

{albums.length > 0 && (
<Section title="Albums">
<CardList list={albums.map((k) => ({ ...k, sub: k.year }))} />
) : (
<TextBlock
stylePreset="inkBase"
typographyPreset="editorialHeadline020"
>
No albums
</TextBlock>
)}
</Section>
<Section title="Singles">
{singles.length ? (
</Section>
)}

{singles.length > 0 && (
<Section title="Singles">
<CardList list={singles.map((k) => ({ ...k, sub: k.year }))} />
) : (
<TextBlock
stylePreset="inkBase"
typographyPreset="editorialHeadline020"
>
No singles
</TextBlock>
)}
</Section>
</Section>
)}
</GridLayout>
);
};
Expand Down
12 changes: 9 additions & 3 deletions theme/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,22 @@ export default {
stylePreset: "inkBase",
},
menu: {
spaceInline: "space050",
spaceInline: { xs: "space000", lg: "space050" },
},
menuItem: {
horizontal: {
minHeight: "sizing080",
stylePreset: "menuItemHorizontal",
transitionPreset: "backgroundColorChange",
spaceInline: "space030",
spaceInset: "spaceInsetSquish030",
typographyPreset: "utilitySubheading040",
spaceInset: {
xs: "spaceInsetSquish010",
lg: "spaceInsetSquish030",
},
typographyPreset: {
xs: "utilitySubheading020",
lg: "utilitySubheading040",
},
},
vertical: {
spaceInline: "space000",
Expand Down

1 comment on commit 6136de8

@vercel
Copy link

@vercel vercel bot commented on 6136de8 Jul 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

newskit-music – ./

newskit-music-mutebg1.vercel.app
newskit-music-git-main-mutebg1.vercel.app
newskit-music.vercel.app

Please sign in to comment.