This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
forked from danskernesdigitalebibliotek/dpl-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A component that uses the button atom and a <p> that accepts these props - currentResults - totalResults
- Loading branch information
1 parent
923e885
commit 7a7f0f3
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/stories/search-result-pagination/SearchResultPagination.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { withDesign } from "storybook-addon-designs"; | ||
import { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
import { SearchResultPagination } from "./SearchResultPagination"; | ||
|
||
export default { | ||
title: "Components / Search Result - Pagination", | ||
component: SearchResultPagination, | ||
decorators: [withDesign], | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: | ||
"https://www.figma.com/file/ETOZIfmgGS1HUfio57SOh7/S%C3%B8gning?node-id=1011%3A15112", | ||
}, | ||
}, | ||
argTypes: { | ||
currentResults: { | ||
control: { type: "text" }, | ||
defaultValue: "10", | ||
}, | ||
totalResults: { | ||
control: { type: "text" }, | ||
defaultValue: "423", | ||
}, | ||
}, | ||
} as ComponentMeta<typeof SearchResultPagination>; | ||
|
||
const Template: ComponentStory<typeof SearchResultPagination> = (args) => { | ||
return <SearchResultPagination {...args} />; | ||
}; | ||
|
||
export const Item = Template.bind({}); | ||
Item.args = {}; |
30 changes: 30 additions & 0 deletions
30
src/stories/search-result-pagination/SearchResultPagination.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Button } from "../button/Button"; | ||
|
||
interface SearchResultPaginationProps { | ||
currentResults: string; | ||
totalResults: string; | ||
} | ||
|
||
export const SearchResultPagination = ({ | ||
currentResults, | ||
totalResults, | ||
}: SearchResultPaginationProps) => { | ||
return ( | ||
<div className="search-result-pagination"> | ||
<p className="text-small-caption search-result-pagination__title"> | ||
{`Viser ${currentResults} ud af ${totalResults} resultater`} | ||
</p> | ||
<Button | ||
label={"VIS FLERE"} | ||
disabled={false} | ||
buttonType={"none"} | ||
collapsible={false} | ||
size={"medium"} | ||
variant={"outline"} | ||
onClick={() => { | ||
console.log("onClick"); | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; |
17 changes: 17 additions & 0 deletions
17
src/stories/search-result-pagination/search-result-pagination.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.search-result-pagination { | ||
&__title { | ||
text-align: center; | ||
margin-top: 24px; | ||
margin-bottom: 16px; | ||
} | ||
} | ||
|
||
// Override button css (Center + Width) | ||
.search-result-pagination > .btn-primary { | ||
margin: 0 auto; | ||
width: 100%; | ||
|
||
@include breakpoint-s { | ||
max-width: 253px; | ||
} | ||
} |