Skip to content

Commit

Permalink
Hotfixes for profile and settings views (#2455)
Browse files Browse the repository at this point in the history
### What's done:
- Fixed incorrect fill of UserInfo (twitter/website) fields
- Fixed trimming and showing of urls on Profile view
- Removed legacy user settings
  • Loading branch information
orchestr7 authored Aug 14, 2023
1 parent 6dc590c commit fdba3b4
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 930 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ val cardUser: FC<IndexViewProps> = FC { props ->
}

div {
className = ClassName("row text-muted border-bottom border-gray mx-3")
className = ClassName("row text-muted border-bottom border-gray mx-3 mt-2")
div {
className = ClassName("col-9")
p {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ fun ChildrenBuilder.renderLeftUserMenu(
}
}

user?.gitHub?.let { extraLinks(faGithub, it) }
user?.gitHub?.let { extraLinks(faGithub, it, listOf(UsefulUrls.GITHUB, UsefulUrls.GITEE)) }

user?.twitter?.let { extraLinks(faTwitter, it) }
user?.twitter?.let { extraLinks(faTwitter, it, listOf(UsefulUrls.TWITTER, UsefulUrls.XCOM)) }

user?.linkedin?.let { extraLinks(faLink, it) }
user?.linkedin?.let { extraLinks(faLinkedIn, it, listOf(UsefulUrls.LINKEDIN)) }

user?.website?.let { extraLinks(faLink, it) }
user?.website?.let { extraLinks(faLink, it, listOf(UsefulUrls.HTTPS, UsefulUrls.HTTP)) }

if (organizations.isNotEmpty()) {
div {
Expand Down Expand Up @@ -243,16 +243,21 @@ fun ChildrenBuilder.renderLeftUserMenu(
/**
* @param icon
* @param info
* @param patterns
*/
fun ChildrenBuilder.extraLinks(icon: FontAwesomeIconModule, info: String) {
div {
className = ClassName("mb-2")
fontAwesomeIcon(icon = icon) {
it.className = "fas fa-sm fa-fw mr-2 text-gray-900"
}
a {
href = info
+info.substringAfterLast("/")
fun ChildrenBuilder.extraLinks(icon: FontAwesomeIconModule, info: String, patterns: List<UsefulUrls>) {
val foundPattern = patterns.map { it.value }.findLast { info.startsWith(it) }
foundPattern?.let {
val trimmedUserName = info.substringAfterLast(foundPattern)
div {
className = ClassName("mb-2")
fontAwesomeIcon(icon = icon) {
it.className = "fas fa-sm fa-fw mr-2 text-gray-900"
}
a {
href = info
+trimmedUserName
}
}
}
}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit fdba3b4

Please sign in to comment.