Skip to content
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

feat(core): allow passing global app name and app icon #5993

Merged
merged 17 commits into from
May 29, 2024

Conversation

aliemir
Copy link
Member

@aliemir aliemir commented May 27, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

Changes

Added ability to pass global app name and icon values through <Refine /> component's options prop.

Now <Refine /> component accepts options.title prop that can be used to set app icon and app name globally. By default these values will be accessible through useRefineOptions hook and will be used in <ThemedLayoutV2 /> and <AuthPage /> components of the UI packages.

import { Refine } from "@refinedev/core";

const MyIcon = () => <svg>{/* ... */}</svg>;

const App = () => {
  return (
    <Refine
      options={{
        title: {
          icon: <MyIcon />,
          text: "Refine App",
        },
      }}
    >
      {/* ... */}
    </Refine>
  );
};

RK-634

@aliemir aliemir requested a review from a team as a code owner May 27, 2024 12:38
Copy link

changeset-bot bot commented May 27, 2024

🦋 Changeset detected

Latest commit: e9b1113

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@refinedev/core Minor
@refinedev/ui-tests Patch
@refinedev/ui-types Patch
@refinedev/chakra-ui Minor
@refinedev/mantine Minor
@refinedev/antd Minor
@refinedev/mui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@refine-bot refine-bot temporarily deployed to deploy-preview-antd-5993 May 27, 2024 13:33 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-mui-5993 May 27, 2024 13:34 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-website-5993 May 27, 2024 13:49 Inactive
Copy link

cypress bot commented May 27, 2024

Passing run #11161 ↗︎

0 379 37 0 Flakiness 0

Details:

Merge e9b1113 into a2e53d2...
Project: refine Commit: 0cd891fa16 ℹ️
Status: Passed Duration: 21:54 💡
Started: May 29, 2024 1:39 PM Ended: May 29, 2024 2:01 PM

Review all test suite changes for PR #5993 ↗︎

Copy link
Member

@BatuhanW BatuhanW left a comment

Choose a reason for hiding this comment

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

LGTM. Added a minor comment on possibly missing tests.

smile-nod

Comment on lines +13 to +23
icon: iconFromProps,
text: textFromProps,
wrapperStyles,
}) => {
const {
title: { icon: defaultIcon, text: defaultText },
} = useRefineOptions();
const icon =
typeof iconFromProps === "undefined" ? defaultIcon : iconFromProps;
const text =
typeof textFromProps === "undefined" ? defaultText : textFromProps;
Copy link
Member

Choose a reason for hiding this comment

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

I think we can update tests for this and other UI library components.

@aliemir aliemir added this to the June Release milestone May 28, 2024
@refine-bot refine-bot temporarily deployed to deploy-preview-antd-5993 May 28, 2024 07:06 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-mui-5993 May 28, 2024 07:07 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-website-5993 May 28, 2024 07:25 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-antd-5993 May 29, 2024 11:46 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-mui-5993 May 29, 2024 11:47 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-antd-5993 May 29, 2024 12:04 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-mui-5993 May 29, 2024 12:05 Inactive
@refine-bot refine-bot temporarily deployed to deploy-preview-website-5993 May 29, 2024 12:25 Inactive
@BatuhanW BatuhanW merged commit 9749bd3 into releases/june May 29, 2024
89 of 91 checks passed
@BatuhanW BatuhanW deleted the feat/ability-to-pass-global-title-values branch May 29, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants