mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-07 01:51:36 -04:00
Add application state hook (#1308)
* Add application state hook Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Add docs Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4720f2d36b
commit
829cc2fe48
47 changed files with 149 additions and 195 deletions
|
@ -5,8 +5,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { ApplicationState } from '../../../redux'
|
||||
import { useApplicationState } from '../../../hooks/common/use-application-state'
|
||||
import { IconName } from '../../common/fork-awesome/types'
|
||||
import { SocialLinkButton } from './social-link-button/social-link-button'
|
||||
|
||||
|
@ -108,7 +107,7 @@ export interface ViaOneClickProps {
|
|||
}
|
||||
|
||||
export const ViaOneClick: React.FC<ViaOneClickProps> = ({ oneClickType, optionalName }) => {
|
||||
const backendUrl = useSelector((state: ApplicationState) => state.apiUrl.apiUrl)
|
||||
const backendUrl = useApplicationState((state) => state.apiUrl.apiUrl)
|
||||
const { name, icon, className, url } = getMetadata(backendUrl, oneClickType)
|
||||
const text = optionalName || name
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue