Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Daily Thought App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COM3014-Coursework
Daily Thought App
Commits
ba9b05a8
Commit
ba9b05a8
authored
2 years ago
by
Matt Kirby
Browse files
Options
Downloads
Patches
Plain Diff
Styled completion form
parent
01cd813b
No related branches found
No related tags found
1 merge request
!24
Fe questions and posts (This one is big)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
daily-thought-frontend/src/components/form/DailyCompletion.tsx
+23
-23
23 additions, 23 deletions
...-thought-frontend/src/components/form/DailyCompletion.tsx
with
23 additions
and
23 deletions
daily-thought-frontend/src/components/form/DailyCompletion.tsx
+
23
−
23
View file @
ba9b05a8
import
{
Dialog
,
Transition
}
from
"
@headlessui/react
"
;
import
{
Dialog
,
Transition
}
from
'
@headlessui/react
'
;
import
{
FC
,
Fragment
,
PropsWithChildren
,
useEffect
,
useState
}
from
"
react
"
;
import
{
CheckCircleIcon
}
from
'
@heroicons/react/24/outline
'
;
import
{
FC
,
Fragment
,
PropsWithChildren
,
useEffect
,
useState
}
from
'
react
'
;
type
DailyCompletionProps
=
{
type
DailyCompletionProps
=
{
show
:
boolean
show
:
boolean
;
}
}
;
const
DailyPostCompletion
:
FC
<
PropsWithChildren
<
DailyCompletionProps
>>
=
({
const
DailyPostCompletion
:
FC
<
PropsWithChildren
<
DailyCompletionProps
>>
=
({
show
})
=>
{
show
})
=>
{
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
);
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
);
const
[
done
,
setDone
]
=
useState
(
false
)
const
[
done
,
setDone
]
=
useState
(
false
)
;
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
isOpen
&&
show
&&
!
done
){
if
(
!
isOpen
&&
show
&&
!
done
)
{
setIsOpen
(
true
)
setIsOpen
(
true
)
;
setDone
(
true
)
setDone
(
true
)
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
setIsOpen
(
false
)
setIsOpen
(
false
)
;
},
3000
)
},
3000
)
;
}
}
})
})
;
return
(
return
(
<>
<>
...
@@ -52,17 +51,18 @@ const DailyPostCompletion:FC<PropsWithChildren<DailyCompletionProps>> = ({
...
@@ -52,17 +51,18 @@ const DailyPostCompletion:FC<PropsWithChildren<DailyCompletionProps>> = ({
<
Dialog
.
Panel
className
=
"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all"
>
<
Dialog
.
Panel
className
=
"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all"
>
<
Dialog
.
Title
<
Dialog
.
Title
as
=
"h3"
as
=
"h3"
className
=
"text-lg font-medium leading-6 text-gray-900"
className
=
"text-lg font-medium leading-6 text-gray-900
text-center
"
>
>
Payment successful
<
div
className
=
"w-full flex justify-center mb-2"
>
<
CheckCircleIcon
className
=
"h-12 w-12 rounded-full text-c-pink flex items-center justify-center"
/>
</
div
>
Your Daily has been posted!
</
Dialog
.
Title
>
</
Dialog
.
Title
>
<
div
className
=
"mt-2"
>
<
div
className
=
"mt-2"
>
<
p
className
=
"text-sm text-gray-500"
>
<
p
className
=
"text-sm text-gray-500 text-center"
>
Your payment has been successfully submitted. We’ve sent
Now have a look at what your friends have said :)
you an email with all of the details of your order.
</
p
>
</
p
>
</
div
>
</
div
>
</
Dialog
.
Panel
>
</
Dialog
.
Panel
>
</
Transition
.
Child
>
</
Transition
.
Child
>
</
div
>
</
div
>
...
@@ -70,7 +70,7 @@ const DailyPostCompletion:FC<PropsWithChildren<DailyCompletionProps>> = ({
...
@@ -70,7 +70,7 @@ const DailyPostCompletion:FC<PropsWithChildren<DailyCompletionProps>> = ({
</
Dialog
>
</
Dialog
>
</
Transition
>
</
Transition
>
</>
</>
)
)
;
}
}
;
export
default
DailyPostCompletion
;
export
default
DailyPostCompletion
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment