-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WelcomeView -> saveWelcomeView (#2328)
### What's done: * Refactored WelcomeView - now it is FC instead of ClassComponent * Fixed frontend compiler warnings
- Loading branch information
1 parent
753c9c4
commit cf68fc0
Showing
23 changed files
with
378 additions
and
428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
.../src/main/kotlin/com/saveourtool/save/frontend/components/mobile/SaveWelcomeMobileView.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
@file:Suppress("HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE") | ||
|
||
package com.saveourtool.save.frontend.components.mobile | ||
|
||
import com.saveourtool.save.frontend.components.views.welcome.chevron | ||
import com.saveourtool.save.frontend.components.views.welcome.pagers.allWelcomePagers | ||
import com.saveourtool.save.frontend.components.views.welcome.pagers.renderReadMorePage | ||
import com.saveourtool.save.frontend.components.views.welcome.welcomeMarketingTitle | ||
import com.saveourtool.save.frontend.externals.animations.animator | ||
import com.saveourtool.save.frontend.externals.animations.scrollContainer | ||
import com.saveourtool.save.frontend.externals.animations.scrollPage | ||
import com.saveourtool.save.frontend.utils.particles | ||
|
||
import js.core.jso | ||
import react.ChildrenBuilder | ||
import react.VFC | ||
import react.dom.html.ReactHTML.b | ||
import react.dom.html.ReactHTML.div | ||
import react.dom.html.ReactHTML.h4 | ||
import react.dom.html.ReactHTML.img | ||
import web.cssom.* | ||
|
||
/** | ||
* As a temp stub it was decided to make several views to make SAVE looking nice on mobile devices | ||
*/ | ||
val saveWelcomeMobileView: VFC = VFC { | ||
div { | ||
style = jso { | ||
background = | ||
"-webkit-linear-gradient(270deg, rgb(209, 229, 235), rgb(217, 215, 235))".unsafeCast<Background>() | ||
} | ||
particles() | ||
sorryYourScreenIsTooSmall() | ||
} | ||
} | ||
|
||
private fun ChildrenBuilder.sorryYourScreenIsTooSmall() { | ||
notSupportedMobileYet() | ||
title() | ||
chevron("rgb(6, 7, 89)") | ||
|
||
@Suppress("EMPTY_BLOCK_STRUCTURE_ERROR") | ||
scrollContainer { | ||
scrollPage {} | ||
allWelcomePagers.forEach { pager -> | ||
scrollPage { } | ||
pager.forEach { | ||
scrollPage { | ||
div { | ||
animator { | ||
animation = it.animation | ||
it.renderPage(this) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
renderReadMorePage() | ||
} | ||
|
||
private fun ChildrenBuilder.notSupportedMobileYet() { | ||
div { | ||
className = ClassName("row d-flex justify-content-center mx-auto text-danger mt-2") | ||
h4 { | ||
className = ClassName("text-center") | ||
+"We do not " | ||
b { | ||
+"yet " | ||
} | ||
+"support devices with small screen size. But you can get familiar with SAVE using the information below." | ||
} | ||
} | ||
div { | ||
className = ClassName("row d-flex justify-content-center mx-auto") | ||
img { | ||
src = "img/sad_cat.gif" | ||
@Suppress("MAGIC_NUMBER") | ||
style = jso { | ||
width = 12.rem | ||
} | ||
} | ||
} | ||
} | ||
|
||
private fun ChildrenBuilder.title() { | ||
div { | ||
className = ClassName("row justify-content-center mx-auto") | ||
// Marketing information | ||
welcomeMarketingTitle("text-primary", true) | ||
} | ||
} |
104 changes: 0 additions & 104 deletions
104
...tend/src/main/kotlin/com/saveourtool/save/frontend/components/mobile/WelcomeMobileView.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.