Skip to content

Commit

Permalink
feat(core): override <GitHubBanner /> style (#5964)
Browse files Browse the repository at this point in the history
  • Loading branch information
alicanerdurmaz authored and BatuhanW committed Jun 4, 2024
1 parent 45b68cc commit 4cc7447
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .changeset/smooth-shirts-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@refinedev/core": patch
---

feat: `<GitHubBanner />` has `paddingLeft: 200px` by default to make space for the sidebar. This is not needed when the sidebar is not present.

From on, `<GitHubBanner />` style property can be overridden by passing `containerStyle` prop.

```jsx
<GitHubBanner containerStyle={{ paddingLeft: 0 }} />
```
9 changes: 7 additions & 2 deletions packages/core/src/components/gh-banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React, { SVGProps, useEffect } from "react";
import React, { CSSProperties, SVGProps, useEffect } from "react";
import { CSSRules } from "./styles";

const text =
"If you find Refine useful, you can contribute to its growth by giving it a star on GitHub";

export const GitHubBanner = () => {
type Props = {
containerStyle?: CSSProperties;
};

export const GitHubBanner = ({ containerStyle }: Props) => {
useEffect(() => {
const styleTag = document.createElement("style");
document.head.appendChild(styleTag);
Expand Down Expand Up @@ -32,6 +36,7 @@ export const GitHubBanner = () => {
maxWidth: "100vw",
height: "100%",
borderBottom: "1px solid #47ebeb26",
...containerStyle,
}}
>
<div
Expand Down

0 comments on commit 4cc7447

Please sign in to comment.