Skip to content

Commit

Permalink
feat: add fontSize prop
Browse files Browse the repository at this point in the history
  • Loading branch information
KnowsCount committed Mar 18, 2022
1 parent 73926f2 commit 5563541
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/heatmap/Heatmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export interface IProps {
* @default 15px
*/
squareSize?: string
/**
* @description size of font on graph (not including tooltip font size).
* @default 12px
*/
fontSize?: string
/**
* @description the content to display in the tooltip.
* @default '${count[i]} contributions on this day'
Expand All @@ -53,6 +58,7 @@ const Heatmap: React.FC<IProps> = (props: {
count: number[]
squareGap?: string
squareSize?: string
fontSize?: string
tooltipContent?: string
}) => {
// variables
Expand All @@ -68,6 +74,7 @@ const Heatmap: React.FC<IProps> = (props: {
let level: number[] = count.map((i: number) => transformCount(i))
let squareGap: string = props.squareGap || DEFAULT_SQUARE_GAP
let squareSize: string = props.squareSize || DEFAULT_SQUARE_SIZE
let fontSize: string = props.fontSize || '12px'
let weekWidth: string =
String(
transformPixelsToNumber(squareGap) +
Expand All @@ -78,7 +85,7 @@ const Heatmap: React.FC<IProps> = (props: {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
font-size: 12px;
font-size: ${fontSize};
box-sizing: border-box;
ul {
padding-inline-start: 0;
Expand Down

1 comment on commit 5563541

@vercel
Copy link

@vercel vercel bot commented on 5563541 Mar 18, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.