Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proof of concept for licensing#3008

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
presleyp wants to merge7 commits intomainfromlicensing-poc/presleyp/2904
Closed
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
add LicenseBanner that calls xservice
  • Loading branch information
@presleyp
presleyp committedJul 15, 2022
commit9aa9f04c81efb7f76a22630a51cbe3a7834b7491
20 changes: 20 additions & 0 deletionssite/src/components/LicenseBanner/LicenseBanner.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
import { useActor } from "@xstate/react"
import { useContext, useEffect } from "react"
import { XServiceContext } from "../../xServices/StateContext"

export const LicenseBanner: React.FC = () => {
const xServices = useContext(XServiceContext)
const [licenseState, licenseSend] = useActor(xServices.licenseXService)
const warnings = licenseState.context.licenseData.warnings

/** Gets license data on app mount because LicenseBanner is mounted in App */
useEffect(() => {
licenseSend("GET_LICENSE_DATA")
}, [licenseSend])

if (warnings) {
return <div>{warnings.map((warning, i) => <p key={`${i}`}>{warning}</p>)}</div>
} else {
return null
}
}

[8]ページ先頭

©2009-2025 Movatter.jp