Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend-react
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
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
YAPEX
frontend-react
Commits
de45a7f2
Commit
de45a7f2
authored
5 years ago
by
Janis Daniel Dähne
Browse files
Options
Downloads
Patches
Plain Diff
- modified 404 chat styling
- added auto scroll disable
parent
a636391b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/404internal/Chat404.tsx
+27
-10
27 additions, 10 deletions
src/components/404internal/Chat404.tsx
src/components/404internal/style.styl
+15
-2
15 additions, 2 deletions
src/components/404internal/style.styl
with
42 additions
and
12 deletions
src/components/404internal/Chat404.tsx
+
27
−
10
View file @
de45a7f2
...
...
@@ -51,6 +51,8 @@ type ChatMessage = ConversationUserEntered | ConversationMessage
interface
State
{
// tslint:disable-next-line
readonly
currentConversation
:
ChatMessage
[]
readonly
isAutoScrollBotEnabled
:
boolean
}
const
chatWrapperId
=
'
chat-window-wrapper
'
...
...
@@ -75,6 +77,7 @@ class Chat404 extends React.Component<Props, State> {
this
.
state
=
{
currentConversation
:
[],
isAutoScrollBotEnabled
:
true
,
}
}
...
...
@@ -148,7 +151,10 @@ class Chat404 extends React.Component<Props, State> {
}
as
ChatMessage
this
.
scrollToBottom
()
if
(
this
.
state
.
isAutoScrollBotEnabled
)
{
this
.
scrollToBottom
()
}
await
wait
(
this
.
getTypingTimeInMsFromMsg
(
message
.
message
))
//remove old message and insert new with changed props
...
...
@@ -170,7 +176,10 @@ class Chat404 extends React.Component<Props, State> {
}
as
State
})
this
.
scrollToBottom
()
if
(
this
.
state
.
isAutoScrollBotEnabled
)
{
this
.
scrollToBottom
()
}
await
wait
(
this
.
getReadTimeInMsFromMsg
(
message
.
message
))
}
...
...
@@ -192,7 +201,11 @@ class Chat404 extends React.Component<Props, State> {
404
</
div
>
<
div
className
=
"down-button clickable"
onClick
=
{
()
=>
{
<
div
className
=
{
`down-button clickable
${
this
.
state
.
isAutoScrollBotEnabled
?
'
is-enabled
'
:
''
}
`
}
onClick
=
{
()
=>
{
this
.
setState
((
prevState
,
props
)
=>
({
...
prevState
,
isAutoScrollBotEnabled
:
!
prevState
.
isAutoScrollBotEnabled
}))
this
.
scrollToBottom
()
}
}
>
<
Icon
name
=
"chevron down"
/>
...
...
@@ -228,7 +241,9 @@ class Chat404 extends React.Component<Props, State> {
}
if
(
value
.
withLoading
)
{
return
(<
div
key
=
{
key
}
className
=
"chat-entry foreign-message is-typing"
>
return
(<
div
key
=
{
key
}
className
=
{
`chat-entry foreign-message is-typing
${
value
.
name
===
'
Janis
'
?
'
alternate
'
:
''
}
`
}
>
<
div
className
=
{
`user-name
${
value
.
name
===
'
Janis
'
?
'
alternate
'
:
''
}
`
}
>
{
value
.
name
}
</
div
>
...
...
@@ -240,7 +255,9 @@ class Chat404 extends React.Component<Props, State> {
</
div
>)
}
return
(<
div
key
=
{
key
}
className
=
"chat-entry foreign-message"
>
return
(<
div
key
=
{
key
}
className
=
{
`chat-entry foreign-message
${
value
.
name
===
'
Janis
'
?
'
alternate
'
:
''
}
`
}
>
<
div
className
=
{
`user-name
${
value
.
name
===
'
Janis
'
?
'
alternate
'
:
''
}
`
}
>
{
value
.
name
}
</
div
>
...
...
@@ -272,11 +289,11 @@ const conversion: ReadonlyArray<ChatMessage> = [
kind
:
'
user-entered
'
,
message
:
'
Janis hat den Chat betreten
'
},
{
kind
:
'
message
'
,
message
:
'
???
'
,
withLoading
:
false
},
//
{
//
kind: 'message',
//
message: '???',
//
withLoading: false
//
},
{
kind
:
'
message
'
,
name
:
'
Steffen
'
,
...
...
This diff is collapsed.
Click to expand it.
src/components/404internal/style.styl
+
15
−
2
View file @
de45a7f2
...
...
@@ -18,12 +18,20 @@
justify-content: center;
align-items: center;
z-index 2
box-shadow: 0 3px 2px -2px #c3c3c3
.icon {
margin 0
}
&.is-enabled {
opacity 1 !important
border 1px solid #099eff
border-radius 50%
}
}
.watermark {
pointer-events none
position absolute
...
...
@@ -42,6 +50,7 @@
background-clip: text;
color: transparent;
text-shadow: rgba(255, 255, 255, 0.5) 0px 3px 3px;
opacity 0.2
}
}
...
...
@@ -52,7 +61,7 @@
}
.chat-window {
width
100%
width
calc(100% - 3em)
display flex
flex-direction column
padding 1em
...
...
@@ -67,7 +76,7 @@
margin-bottom 1em
max-width 90%
padding 0.3em
box-shadow: 0
px
3px 2px -2px #c3c3c3
box-shadow: 0 3px 2px -2px #c3c3c3
&.user-entered {
padding: 0.3em 7px;
...
...
@@ -89,6 +98,10 @@
}
}
&.foreign-message.alternate {
align-self flex-end
}
&.own-message {
background-color rgb(232, 253, 203)
...
...
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