mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 07:14:21 +00:00
💥 Replace useContext
with useLookAndFeel
This commit is contained in:
parent
fc75ff2ede
commit
81dbfbd68b
4 changed files with 8 additions and 13 deletions
|
@ -1,6 +1,5 @@
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import {useContext} from "react";
|
import {useLookAndFeel} from "./LookAndFeel";
|
||||||
import {LookAndFeelContext} from "./LookAndFeel";
|
|
||||||
import {Bluelib} from "@steffo/bluelib-react";
|
import {Bluelib} from "@steffo/bluelib-react";
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +9,7 @@ interface LookAndFeelBluelibProps {
|
||||||
|
|
||||||
|
|
||||||
export function LookAndFeelBluelib({children}: LookAndFeelBluelibProps): JSX.Element {
|
export function LookAndFeelBluelib({children}: LookAndFeelBluelibProps): JSX.Element {
|
||||||
const lookAndFeel = useContext(LookAndFeelContext)
|
const lookAndFeel = useLookAndFeel()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Bluelib theme={lookAndFeel.bluelibTheme}>
|
<Bluelib theme={lookAndFeel.bluelibTheme}>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import {HeadingProps} from "@steffo/bluelib-react/dist/components/common/Heading";
|
import {HeadingProps} from "@steffo/bluelib-react/dist/components/common/Heading";
|
||||||
import {Heading} from "@steffo/bluelib-react";
|
import {Heading} from "@steffo/bluelib-react";
|
||||||
import {useContext} from "react";
|
import {useLookAndFeel} from "./LookAndFeel";
|
||||||
import {LookAndFeelContext} from "./LookAndFeel";
|
|
||||||
|
|
||||||
|
|
||||||
interface LookAndFeelHeadingProps extends HeadingProps {
|
interface LookAndFeelHeadingProps extends HeadingProps {
|
||||||
|
@ -11,7 +10,7 @@ interface LookAndFeelHeadingProps extends HeadingProps {
|
||||||
|
|
||||||
|
|
||||||
export function LookAndFeelHeading({...props}: LookAndFeelHeadingProps): JSX.Element {
|
export function LookAndFeelHeading({...props}: LookAndFeelHeadingProps): JSX.Element {
|
||||||
const lookAndFeel = useContext(LookAndFeelContext)
|
const lookAndFeel = useLookAndFeel()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Heading {...props}>
|
<Heading {...props}>
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import * as ReactDOM from "react-dom"
|
import {useLookAndFeel} from "./LookAndFeel";
|
||||||
import {useContext} from "react";
|
|
||||||
import {LookAndFeelContext} from "./LookAndFeel";
|
|
||||||
|
|
||||||
|
|
||||||
export function LookAndFeelPageTitle(): null {
|
export function LookAndFeelPageTitle(): null {
|
||||||
const lookAndFeel = useContext(LookAndFeelContext)
|
const lookAndFeel = useLookAndFeel()
|
||||||
|
|
||||||
React.useEffect(
|
React.useEffect(
|
||||||
() => {
|
() => {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import {useContext} from "react"
|
|
||||||
import {Anchor, Footer} from "@steffo/bluelib-react";
|
import {Anchor, Footer} from "@steffo/bluelib-react";
|
||||||
import {LookAndFeelContext} from "./LookAndFeel";
|
import {useLookAndFeel} from "./LookAndFeel";
|
||||||
|
|
||||||
|
|
||||||
const FOOTER_COLORS = {
|
const FOOTER_COLORS = {
|
||||||
|
@ -17,7 +16,7 @@ const LICENSE_URL = "https://github.com/Steffo99/sophon/blob/main/LICENSE.txt"
|
||||||
|
|
||||||
|
|
||||||
export function SophonFooter(): JSX.Element {
|
export function SophonFooter(): JSX.Element {
|
||||||
const lookAndFeel = useContext(LookAndFeelContext)
|
const lookAndFeel = useLookAndFeel()
|
||||||
|
|
||||||
const frontendVersion = process.env.REACT_APP_VERSION
|
const frontendVersion = process.env.REACT_APP_VERSION
|
||||||
const backendVersion = lookAndFeel.backendVersion
|
const backendVersion = lookAndFeel.backendVersion
|
||||||
|
|
Loading…
Reference in a new issue