mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
// @flow
|
||||
|
||||
export type Person = {
|
||||
name: string,
|
||||
mail?: string
|
||||
};
|
||||
|
||||
export const EXTENSION_POINT = "avatar.factory";
|
||||
6
scm-ui/ui-components/src/avatar/Avatar.ts
Normal file
6
scm-ui/ui-components/src/avatar/Avatar.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type Person = {
|
||||
name: string;
|
||||
mail?: string;
|
||||
};
|
||||
|
||||
export const EXTENSION_POINT = 'avatar.factory';
|
||||
@@ -1,13 +1,11 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import {binder} from "@scm-manager/ui-extensions";
|
||||
import {Image} from "..";
|
||||
import type { 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
|
||||
person: Person;
|
||||
};
|
||||
|
||||
class AvatarImage extends React.Component<Props> {
|
||||
@@ -19,11 +17,7 @@ class AvatarImage extends React.Component<Props> {
|
||||
const avatar = avatarFactory(person);
|
||||
|
||||
return (
|
||||
<Image
|
||||
className="has-rounded-border"
|
||||
src={avatar}
|
||||
alt={person.name}
|
||||
/>
|
||||
<Image className="has-rounded-border" src={avatar} alt={person.name} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
//@flow
|
||||
import * as React from "react";
|
||||
import {binder} from "@scm-manager/ui-extensions";
|
||||
import { EXTENSION_POINT } from "./Avatar";
|
||||
import * as React from 'react';
|
||||
import { binder } from '@scm-manager/ui-extensions';
|
||||
import { EXTENSION_POINT } from './Avatar';
|
||||
|
||||
type Props = {
|
||||
children: React.Node
|
||||
children: React.Node;
|
||||
};
|
||||
|
||||
class AvatarWrapper extends React.Component<Props> {
|
||||
@@ -1,4 +0,0 @@
|
||||
// @flow
|
||||
|
||||
export { default as AvatarWrapper } from "./AvatarWrapper";
|
||||
export { default as AvatarImage } from "./AvatarImage";
|
||||
2
scm-ui/ui-components/src/avatar/index.ts
Normal file
2
scm-ui/ui-components/src/avatar/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default as AvatarWrapper } from './AvatarWrapper';
|
||||
export { default as AvatarImage } from './AvatarImage';
|
||||
Reference in New Issue
Block a user