From 4e52688ff9b69eadda1099b471e061352a2134f8 Mon Sep 17 00:00:00 2001 From: lukas Date: Tue, 26 Jan 2021 19:14:47 +0100 Subject: [PATCH] add own class for popup when threedot click --- src/elements/Preview/Preview.tsx | 35 ++++++++++++++----- .../QuickActionPop/QuickActionPop.tsx | 24 +++++++++++++ .../QuickActionPopup.module.css | 8 +++++ 3 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 src/elements/QuickActionPop/QuickActionPop.tsx create mode 100644 src/elements/QuickActionPop/QuickActionPopup.module.css diff --git a/src/elements/Preview/Preview.tsx b/src/elements/Preview/Preview.tsx index 2742651..b185836 100644 --- a/src/elements/Preview/Preview.tsx +++ b/src/elements/Preview/Preview.tsx @@ -4,6 +4,9 @@ import {Spinner} from 'react-bootstrap'; import {Link} from 'react-router-dom'; import GlobalInfos from '../../utils/GlobalInfos'; import {callAPIPlain} from '../../utils/Api'; +import {faEllipsisV} from '@fortawesome/free-solid-svg-icons'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import QuickActionPop from '../QuickActionPop/QuickActionPop'; interface PreviewProps { name: string; @@ -12,6 +15,7 @@ interface PreviewProps { interface PreviewState { previewpicture: string | null; + optionsvisible: boolean; } /** @@ -23,7 +27,8 @@ class Preview extends React.Component { super(props); this.state = { - previewpicture: null + previewpicture: null, + optionsvisible: false }; } @@ -38,9 +43,16 @@ class Preview extends React.Component { render(): JSX.Element { const themeStyle = GlobalInfos.getThemeStyle(); return ( - -
-
{this.props.name}
+
+
this.setState({optionsvisible: true})}> + +
+ {this.popupvisible()} +
{this.props.name}
+
{this.state.previewpicture !== null ? { }
-
+ +
-
- - +
); } + + + popupvisible(): JSX.Element { + if (this.state.optionsvisible) + return (heeyyho); + else + return <>; + } } /** diff --git a/src/elements/QuickActionPop/QuickActionPop.tsx b/src/elements/QuickActionPop/QuickActionPop.tsx new file mode 100644 index 0000000..ec9ac67 --- /dev/null +++ b/src/elements/QuickActionPop/QuickActionPop.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import style from './QuickActionPopup.module.css' + +interface props{ + +} + +class QuickActionPop extends React.Component { + constructor(props: props) { + super(props); + + this.state = {}; + } + + render(): JSX.Element { + return ( +
+
{console.log('clicked');}}>testi
testi +
+ ); + } +} + +export default QuickActionPop; diff --git a/src/elements/QuickActionPop/QuickActionPopup.module.css b/src/elements/QuickActionPop/QuickActionPopup.module.css new file mode 100644 index 0000000..543b94c --- /dev/null +++ b/src/elements/QuickActionPop/QuickActionPopup.module.css @@ -0,0 +1,8 @@ +.quickaction { + background-color: white; + width: 90px; + height: 120px; + z-index: 2; + position: absolute; + +}