mirror of
https://github.com/wassname/talk.git
synced 2026-07-16 11:22:16 +08:00
[next] Admin Configure (#2076)
* feat: Add RadioButton and CheckBox * feat: configure facebook and google auth * feat: configure sso, localAuth and displayName + some tests * test: add integration tests for configure auth * test: more integration tests * feat: add oidc support * test: add oidc integration test * feat: generate sso key initially * fix: import fetchQuery from correct package * fix: admin url * fix: set timezone to utc when testing * refactor: improve route config * fix: remove obsolete line * fix: clientMutationId increment * fix: oidc only create when enabled * fix: copy * test: update snapshots * feat: fixed graphql logging extension * Update src/locales/en-US/admin.ftl Co-Authored-By: cvle <vinh@wikiwi.io> * Apply suggestions from code review Co-Authored-By: cvle <vinh@wikiwi.io> * test: update snapshots * fix: change Local Auth to Email Authentication * fix: copy updates
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import { Localized } from "fluent-react/compat";
|
||||
import React from "react";
|
||||
import CopyToClipboard from "react-copy-to-clipboard";
|
||||
|
||||
import { Button } from "talk-ui/components";
|
||||
import { PropTypesOf } from "talk-ui/types";
|
||||
|
||||
interface InnerProps extends PropTypesOf<typeof Button> {
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface State {
|
||||
copied: boolean;
|
||||
}
|
||||
|
||||
class PermalinkPopover extends React.Component<InnerProps> {
|
||||
private timeout: any = null;
|
||||
|
||||
public state: State = {
|
||||
copied: false,
|
||||
};
|
||||
|
||||
public componentWillUnmount() {
|
||||
clearTimeout(this.timeout);
|
||||
}
|
||||
|
||||
private handleCopy = () => {
|
||||
this.setCopied(true);
|
||||
clearTimeout(this.timeout);
|
||||
this.timeout = setTimeout(() => {
|
||||
this.setCopied(false);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
private setCopied = (b: boolean) => {
|
||||
this.setState({
|
||||
copied: b,
|
||||
});
|
||||
};
|
||||
|
||||
public render() {
|
||||
const { text, ...rest } = this.props;
|
||||
const { copied } = this.state;
|
||||
return (
|
||||
<CopyToClipboard text={text} onCopy={this.handleCopy}>
|
||||
<Button color="primary" variant="filled" size="small" {...rest}>
|
||||
{copied ? (
|
||||
<Localized id="framework-copyButton-copied">
|
||||
<span>Copied!</span>
|
||||
</Localized>
|
||||
) : (
|
||||
<Localized id="framework-copyButton-copy">
|
||||
<span>Copy</span>
|
||||
</Localized>
|
||||
)}
|
||||
</Button>
|
||||
</CopyToClipboard>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PermalinkPopover;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from "./CopyButton";
|
||||
@@ -0,0 +1 @@
|
||||
export { default as CopyButton } from "./CopyButton";
|
||||
Reference in New Issue
Block a user