-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from commons-stack/fix/praise_layout
Frontend styling refactor / UI polish
- Loading branch information
Showing
81 changed files
with
982 additions
and
698 deletions.
There are no files selected for viewing
Binary file added
BIN
+1020 KB
.yarn/cache/@fortawesome-free-brands-svg-icons-npm-6.1.1-294dc60d03-a878cc764e.zip
Binary file not shown.
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 |
---|---|---|
@@ -1,23 +1,15 @@ | ||
import { UserAccountModel } from '@useraccount/entities'; | ||
import { generateUserAccountNameRealized } from '@useraccount/utils'; | ||
import { UserDocument } from '../types'; | ||
import { shortenEthAddress } from './core'; | ||
|
||
export const generateUserName = async (user: UserDocument): Promise<string> => { | ||
let username = ''; | ||
|
||
const accounts = await UserAccountModel.find({ user: user._id }); | ||
if (!accounts || accounts.length === 0) | ||
return shortenEthAddress(user.ethereumAddress); | ||
|
||
if (!accounts || accounts.length === 0) { | ||
username = shortenEthAddress(user.ethereumAddress); | ||
} else { | ||
const discordAccount = accounts.find((a) => a.platform === 'DISCORD'); | ||
|
||
if (discordAccount) { | ||
username = discordAccount.name; | ||
} else { | ||
username = accounts[0].name; | ||
} | ||
} | ||
const discordAccount = accounts.find((a) => a.platform === 'DISCORD'); | ||
if (discordAccount) return generateUserAccountNameRealized(discordAccount); | ||
|
||
return username; | ||
return generateUserAccountNameRealized(accounts[0]); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { UserAccountDocument } from './types'; | ||
|
||
export const generateUserAccountNameRealized = ( | ||
userAccount: UserAccountDocument | ||
): string => { | ||
if (userAccount.platform === 'DISCORD') return userAccount.name.split('#')[0]; | ||
return userAccount.name; | ||
}; |
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
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.