mirror of
https://github.com/IT4Change/ohmyform-ui.git
synced 2025-12-13 09:45:50 +00:00
add ability to hide omf badge
This commit is contained in:
parent
698ba04f7e
commit
5a3e7e884f
@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
- mobile improvements for lists and home page
|
||||
- markdown support for page paragraphs and field description
|
||||
- omf badge
|
||||
- hideable omf badge
|
||||
- login notes
|
||||
|
||||
### Changed
|
||||
|
||||
@ -1,7 +1,15 @@
|
||||
import { useQuery } from '@apollo/react-hooks'
|
||||
import React from 'react'
|
||||
import { SETTINGS_QUERY, SettingsQueryData } from '../graphql/query/settings.query'
|
||||
import scss from './omf.module.scss'
|
||||
|
||||
export const Omf: React.FC = () => {
|
||||
const { data, loading } = useQuery<SettingsQueryData>(SETTINGS_QUERY)
|
||||
|
||||
if (loading || data.hideContrib.value) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<a className={scss.badge} href="https://ohmyform.com" target={'_blank'} rel={'noreferrer'}>
|
||||
<span>OhMyForm</span>
|
||||
|
||||
@ -7,6 +7,9 @@ export interface SettingsQueryData {
|
||||
loginNote: {
|
||||
value: string
|
||||
}
|
||||
hideContrib: {
|
||||
value: string
|
||||
}
|
||||
}
|
||||
|
||||
export const SETTINGS_QUERY = gql`
|
||||
@ -17,5 +20,8 @@ export const SETTINGS_QUERY = gql`
|
||||
loginNote: getSetting(key: "LOGIN_NOTE") {
|
||||
value
|
||||
}
|
||||
hideContrib: getSetting(key: "HIDE_CONTRIB") {
|
||||
value: isTrue
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user