-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): Development mode banner (#3731)
Co-authored-by: Alex Carpenter <[email protected]>
- Loading branch information
1 parent
c633f07
commit 0286966
Showing
7 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { useClerk } from '@clerk/clerk-react'; | ||
import type { Attribute, AttributeData, EnvironmentResource } from '@clerk/types'; | ||
import type { Attribute, AttributeData } from '@clerk/types'; | ||
|
||
import { useEnvironment } from './use-environment'; | ||
|
||
export function useAttributes(attribute: Attribute): AttributeData { | ||
const clerk = useClerk(); | ||
const userSettingsAttributes = ((clerk as any)?.__unstable__environment as EnvironmentResource)?.userSettings | ||
.attributes; | ||
const environment = useEnvironment(); | ||
|
||
const userSettingsAttributes = environment.userSettings.attributes; | ||
|
||
return userSettingsAttributes[attribute]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { useClerk } from '@clerk/clerk-react'; | ||
import type { EnvironmentResource } from '@clerk/types'; | ||
|
||
export function useEnvironment() { | ||
const clerk = useClerk(); | ||
return (clerk as any)?.__unstable__environment as EnvironmentResource; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters