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

FR-14220 - Added SteppedUpContent HOC #1082

Merged
merged 19 commits into from
Dec 31, 2023
Merged

FR-14220 - Added SteppedUpContent HOC #1082

merged 19 commits into from
Dec 31, 2023

Conversation

doregg
Copy link
Contributor

@doregg doregg commented Dec 18, 2023

  • Stepped up content implementation - HOC for step up.
  • Including a bug fix when the router has a fallback and no step up configured URL from the client

About the HOC:

  • By default the HOC will step up when needed
  • The user can prevent it by passing preventSteppingUp=true
  • 2 HOCs can't be hosted in the same page simultaneously without prevent one of them to step up (only one can lead the step up action)
import React, { FC } from 'react';
import { SteppedUpContent } from '@frontegg/react';

export const HomePage: FC = (props) => {
  return (
    <>
      <SteppedUpContent maxAge={30}>
        Honey, you are <b style={{ color: '#1665c0' }}>STEPPED UP!</b>
      </SteppedUpContent>

// or the following one:
      <SteppedUpContent
        maxAge={30}
        render={(isSteppedUp) =>
          isSteppedUp ? (
            <div>
              Honey, you are <b style={{ color: '#1665c0' }}>STEPPED UP!</b>
            </div>
          ) : null
        }
      />
    </>
  );
};

@doregg doregg changed the base branch from FR-14232-stepup-onredirecturl-support to master December 24, 2023 08:57
@doregg doregg changed the title FR-14220 - Step up hoc FR-14220 - Added SteppedUpContent HOC Dec 24, 2023
@doregg doregg marked this pull request as ready for review December 24, 2023 08:58
yarn.lock Outdated Show resolved Hide resolved
Copy link
Contributor

@rotemzif1 rotemzif1 left a comment

Choose a reason for hiding this comment

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

@doregg can you please add to the exmaple app here a usage of the component
? I am missing a bit how do we expect them to use the component

@doregg
Copy link
Contributor Author

doregg commented Dec 24, 2023

@doregg can you please add to the exmaple app here a usage of the component ? I am missing a bit how do we expect them to use the component

added to the description

packages/react/package.json Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
@frontegg frontegg deleted a comment from yuvalotem1 Dec 25, 2023
@doregg doregg merged commit 58eecd8 into master Dec 31, 2023
5 checks passed
@frontegg-david frontegg-david deleted the FR-14220-step-up-hoc branch January 14, 2024 17:10
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