Skip to content

Updating Contest Tile to include 2 new variants #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[![Jest](https://github.com/code4rena-dev/components-library/actions/workflows/test-runner.yml/badge.svg)](https://github.com/code4rena-dev/components-library/actions/workflows/test-runner.yml)

# Code4rena Components Library
---

## Using Components in your project

Expand Down Expand Up @@ -36,7 +35,7 @@ import { Alert } from "@code4rena/components-library";
### 4. Typescript Support
All components in this library have TypeScript support. Types for all complex component props are also named exports available through the `/types` subdirectory (see example below):
```
import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/componenets-library/types";
import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/components-library/types";

<Button
label="Sample Button"
Expand Down
1 change: 1 addition & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const wrapperStyle = {
justifyContent: "center",
alignItems: "center",
padding: "0rem 1rem",
marginTop: "2rem",
};

const preview: Preview = {
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[![Jest](https://github.com/code4rena-dev/components-library/actions/workflows/test-runner.yml/badge.svg)](https://github.com/code4rena-dev/components-library/actions/workflows/test-runner.yml)

# Code4rena Components Library
---

## Using Components in your project

Expand Down Expand Up @@ -36,7 +35,7 @@ import { Alert } from "@code4rena/components-library";
### 4. Typescript Support
All components in this library have TypeScript support. Types for all complex component props are also named exports available through the `/types` subdirectory (see example below):
```
import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/componenets-library/types";
import { ButtonSize, ButtonType, ButtonVariant } from "@code4rena/components-library/types";

<Button
label="Sample Button"
Expand Down
18 changes: 12 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@code4rena/components-library",
"version": "1.1.1",
"version": "1.2.0",
"description": "Code4rena's official components library ",
"types": "./dist/lib.d.ts",
"exports": {
Expand Down Expand Up @@ -58,7 +58,7 @@
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-transformer-svg": "^2.0.1",
"sass": "^1.63.6",
"sass": "^1.69.5",
"storybook": "^7.0.26",
"ts-node": "^10.9.1",
"tslib": "^2.6.0",
Expand All @@ -68,6 +68,7 @@
},
"dependencies": {
"clsx": "^1.2.1",
"container-query-polyfill": "^1.0.2",
"date-fns": "^2.30.0",
"luxon": "^3.3.0",
"react-avatar": "^5.0.3",
Expand Down
3 changes: 3 additions & 0 deletions src/lib/ContestStatus/ContestStatus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
justify-content: center;
gap: 0.75rem;
color: $color__white;
font-size: $font-size__text;

.statusindicator {
width: $spacing__s;
Expand All @@ -25,4 +26,6 @@
background: $color__green;
}
}

p { margin: 0; }
}
8 changes: 4 additions & 4 deletions src/lib/ContestStatus/ContestStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const ContestStatus: React.FC<ContestStatusProps> = ({
status && (
<div id={id ?? undefined} className={`c4conteststatus ${className}`}>
<div className={`${styling}`} />
{status === Status.UPCOMING && "Soon"}
{status === Status.LIVE && "Live"}
{status === Status.ENDED && "Ended"}
{!status && "-"}
{status === Status.UPCOMING && <p>Soon</p>}
{status === Status.LIVE && <p>Live</p>}
{status === Status.ENDED && <p>Ended</p>}
{!status && <p>-</p>}
</div>
)
);
Expand Down
Loading