Skip to content

Commit acef3f5

Browse files
committed
client: added a new borderRadius input field
1 parent d8337c5 commit acef3f5

13 files changed

Lines changed: 35 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ We suggest not editing the query parameters manually, use [our website](https://
5959
| **theme** | `?theme=github_dark` | github | The theme of the card. You can browse between the themes [here](#-themes). |
6060
| **align** | `?align=center` | left | The alignment of the badges. (`left`, `center`, `right`) |
6161
| **showBorder** | `?showBorder=false` | true | Display the border around the card or not. (`true`, `false`) |
62+
| **borderRadius** | `?borderRadius=12.5` | 4.5 | Value between 0 and 50. |
6263
| **lineCount** | `?lineCount=2` | 1 | The number of lines you want to add to your card. |
6364
| **line{n}** | `?line1=typescript,typescript,2D79C7` | - | The current line of the badge, where {n} is a number. *`(1 <= n <= lineCount)`* |
6465

client/build/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

client/build/static/js/main.9a4f379f.js.map renamed to client/build/static/js/main.2447a062.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/atoms.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ export const linesState = atom({
3030
key: "lines",
3131
default: [] as Line[],
3232
});
33+
34+
export const borderRadiusState = atom({
35+
key: "borderRadius",
36+
default: "4.5",
37+
});

client/src/sections/Options.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import GreenButton from "../components/buttons/GreenButton";
77
import { useRecoilState } from "recoil";
88
import {
99
alignState,
10+
borderRadiusState,
1011
borderState,
1112
lineCountState,
1213
linesState,
@@ -35,6 +36,7 @@ const Options: FC<OptionsProps> = (props) => {
3536
const [align, setAlign] = useRecoilState(alignState);
3637
const [lines, setLines] = useRecoilState(linesState);
3738
const [showBorder, setShowBorder] = useRecoilState(borderState);
39+
const [borderRadius, setBorderRadius] = useRecoilState(borderRadiusState);
3840

3941
useEffect(() => {
4042
// create an array with the numbers of lineCount to 1
@@ -112,6 +114,13 @@ const Options: FC<OptionsProps> = (props) => {
112114
value={showBorder}
113115
/>
114116

117+
<Input
118+
label="Border radius"
119+
placeholder="4.5"
120+
value={borderRadius}
121+
setValue={setBorderRadius}
122+
/>
123+
115124
<div className="w-[92%] h-[.8px] bg-gh-border mx-auto" />
116125

117126
{lineChars.map((line) => (
@@ -122,7 +131,15 @@ const Options: FC<OptionsProps> = (props) => {
122131
icon={IoHammerOutline}
123132
onClick={() => {
124133
props.setLink(
125-
generateLink(title, lineCount, theme, align, lines, showBorder)
134+
generateLink(
135+
title,
136+
lineCount,
137+
theme,
138+
align,
139+
lines,
140+
showBorder,
141+
borderRadius
142+
)
126143
);
127144
}}
128145
disabled={false}

client/src/utils/generate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ export const generateLink = (
66
theme: string,
77
align: string,
88
lines: Line[],
9-
showBorder: boolean
9+
showBorder: boolean,
10+
borderRadius: string
1011
): string => {
1112
// replace every space with %20
1213
title = title.replace(/[ ]/g, "%20");
1314

14-
let res = `https://github-readme-tech-stack.vercel.app/api/cards?title=${title}&lineCount=${lineCount}&theme=${theme}&align=${align}&showBorder=${showBorder}`;
15+
let res = `https://github-readme-tech-stack.vercel.app/api/cards?title=${title}&lineCount=${lineCount}&theme=${theme}&align=${align}&showBorder=${showBorder}&borderRadius=${borderRadius}`;
1516

1617
for (const l of lines) {
1718
// if the line doesn't contain badges

src/cards/card.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,3 @@ export default class Card {
7777
this.borderRadius = borderRadius;
7878
};
7979
}
80-

0 commit comments

Comments
 (0)