mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
migrate ui-components from flow to typescript
This commit is contained in:
@@ -3,4 +3,4 @@ export type Person = {
|
||||
mail?: string;
|
||||
};
|
||||
|
||||
export const EXTENSION_POINT = 'avatar.factory';
|
||||
export const EXTENSION_POINT = "avatar.factory";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { binder } from '@scm-manager/ui-extensions';
|
||||
import { Image } from '..';
|
||||
import { Person } from './Avatar';
|
||||
import { EXTENSION_POINT } from './Avatar';
|
||||
import React from "react";
|
||||
import { binder } from "@scm-manager/ui-extensions";
|
||||
import { Image } from "..";
|
||||
import { Person } from "./Avatar";
|
||||
import { EXTENSION_POINT } from "./Avatar";
|
||||
|
||||
type Props = {
|
||||
person: Person;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import { binder } from '@scm-manager/ui-extensions';
|
||||
import { EXTENSION_POINT } from './Avatar';
|
||||
import React, { Component, ReactNode } from "react";
|
||||
import { binder } from "@scm-manager/ui-extensions";
|
||||
import { EXTENSION_POINT } from "./Avatar";
|
||||
|
||||
type Props = {
|
||||
children: React.Node;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
class AvatarWrapper extends React.Component<Props> {
|
||||
class AvatarWrapper extends Component<Props> {
|
||||
render() {
|
||||
if (binder.hasExtension(EXTENSION_POINT)) {
|
||||
return <>{this.props.children}</>;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default as AvatarWrapper } from './AvatarWrapper';
|
||||
export { default as AvatarImage } from './AvatarImage';
|
||||
export { default as AvatarWrapper } from "./AvatarWrapper";
|
||||
export { default as AvatarImage } from "./AvatarImage";
|
||||
|
||||
Reference in New Issue
Block a user