mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
331533d724
refs https://github.com/TryGhost/Team/issues/3504 This migrates comments-ui to TypeScript. Only `App.js` is left to migrate, but since this isn't using hooks yet, it will need a bigger rewrite so this will need to happen in a separate PR.
25 lines
783 B
TypeScript
25 lines
783 B
TypeScript
import AddDetailsPopup from './components/popups/AddDetailsPopup';
|
|
import React from 'react';
|
|
import ReportPopup from './components/popups/ReportPopup';
|
|
|
|
/** List of all available pages in Comments-UI, mapped to their UI component
|
|
* Any new page added to comments-ui needs to be mapped here
|
|
*/
|
|
export const Pages = {
|
|
addDetailsPopup: AddDetailsPopup,
|
|
reportPopup: ReportPopup
|
|
};
|
|
export type PageName = keyof typeof Pages;
|
|
|
|
type PageTypes = {
|
|
[name in PageName]: {
|
|
type: name,
|
|
/**
|
|
* Called when closing the popup
|
|
* @param succeeded False if normal cancel/close buttons are used
|
|
*/
|
|
callback?: (succeeded: boolean) => void,
|
|
} & React.ComponentProps<typeof Pages[name]>
|
|
}
|
|
|
|
export type Page = PageTypes[keyof PageTypes]
|