Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
plebeius-eth committed Oct 27, 2024
1 parent 4520b62 commit b3773e7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
25 changes: 17 additions & 8 deletions src/components/header/header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
position: relative;
background-color: var(--background-primary);
font-size: 12px;
/* Add flex display */
display: flex;
flex-direction: column;
}

.container {
display: flex;
align-items: flex-end;
align-items: flex-end; /* This aligns children to bottom */
justify-content: flex-start;
white-space: nowrap;
}
Expand Down Expand Up @@ -98,40 +101,46 @@
.tabMenu {
list-style-type: none;
white-space: nowrap;
display: inline-block;
vertical-align: bottom;
display: flex;
align-items: flex-end;
text-transform: lowercase;
}

.tabMenu li {
display: inline;
display: inline-flex;
align-items: flex-end;
font-weight: bold;
margin: 0px 3px;
line-height: 1.3;
}

.tabMenu li a {
padding: 2px 6px 0 6px;
background-color: var(--background-secondary);
text-decoration: none;
color: var(--text-primary);
box-sizing: border-box;
}

.tabMenu .selected a {
color: var(--green);
background-color: var(--background);
border: 1px solid var(--border-primary);
border-bottom: 1px solid var(--background);
padding: 2px 6px 0 6px;
display: inline-flex;
align-items: flex-end;
margin-bottom: -1px;
}

.tabs {
.horizontalScroll {
display: flex;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
padding-top: 5px;
}

.tabs::-webkit-scrollbar {
.horizontalScroll::-webkit-scrollbar {
display: none;
}

Expand Down Expand Up @@ -166,4 +175,4 @@

.lowercase {
text-transform: lowercase;
}
}
2 changes: 1 addition & 1 deletion src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const Header = () => {
)}
</div>
{isMobile && !isInSubplebbitSubmitView && (
<ul className={`${styles.tabMenu} ${styles.tabs}`}>
<ul className={`${styles.tabMenu} ${isInProfileView ? styles.horizontalScroll : ''}`}>
<HeaderTabs />
{(isInHomeView || isInAboutView || isInHomeSidebarView) && <AboutButton />}
{(isInHomeView || isInAllView || isInSidebarView || isInSubplebbitView || isInPostView || isInAboutView) && <SidebarButton />}
Expand Down
2 changes: 1 addition & 1 deletion src/views/about/about.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.content {
padding: 7px 5px 0px 5px;
padding: 7px 5px 30px 5px;
}

.about {
Expand Down
5 changes: 3 additions & 2 deletions src/views/about/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ const About = () => {
<h3 id='registerUsername'>Can I register a username?</h3>
<p>
You can set a display name for your account in the <Link to='/settings#displayName'>preferences</Link>. Your account address (u/{account?.author?.shortAddress})
is generated randomly from a cryptographic hash of your public key, similarly to how a bitcoin address is generated. You can change your account address to a
readable name unique to you, by resolving it with a decentralized domain name service such as{' '}
is generated randomly from a cryptographic hash of your public key, similarly to how a bitcoin address is generated. You can{' '}
<HashLink to='/settings#cryptoAddress'>change your account address</HashLink> to a unique readable name you own, by resolving it with a decentralized domain
name service such as{' '}
<a href='https://sns.id' target='_blank' rel='noopener noreferrer'>
ENS
</a>{' '}
Expand Down
6 changes: 3 additions & 3 deletions src/views/profile/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,25 +240,25 @@ const Profile = () => {
const { t } = useTranslation();
const account = useAccount();
const isMobile = useWindowWidth() < 640;
const [showInfobar, setShowInfobar] = useState(false);

const profileTitle = account?.author?.displayName ? `${account?.author?.displayName} (u/${account?.author?.shortAddress})` : `u/${account?.author?.shortAddress}`;
useEffect(() => {
document.title = profileTitle + ' - Seedit';
}, [t, profileTitle]);

// only show infobar on first profile access and if the current account wasn't imported
const showInfobarRef = useRef(false);
useEffect(() => {
const wasProfileAccessed = localStorage.getItem('wasProfileAccessed');
const importedAccountAddress = localStorage.getItem('importedAccountAddress');

if (!wasProfileAccessed && importedAccountAddress !== account?.author?.address) {
showInfobarRef.current = true;
setShowInfobar(true);
localStorage.setItem('wasProfileAccessed', 'true');
}
}, [account?.author?.address]);

const infobar = showInfobarRef.current && (
const infobar = showInfobar && (
<div className={styles.infobar}>
<Trans
i18nKey='profile_info'
Expand Down
2 changes: 1 addition & 1 deletion src/views/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const GeneralSettings = () => {
<DisplayNameSetting />
</span>
</div>
<div className={styles.category}>
<div className={`${styles.category} ${location.hash === '#cryptoAddress' ? styles.highlightedSetting : ''}`} id='cryptoAddress'>
<span className={styles.categoryTitle}>{t('crypto_address')}</span>
<span className={styles.categorySettings}>
<AddressSettings />
Expand Down
6 changes: 3 additions & 3 deletions src/views/subplebbit/subplebbit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ const Subplebbit = () => {
let footerFirstLine;
let footerSecondLine;

if (feed.length === 0 && isOnline) {
if (feed.length === 0 && isOnline && started && !isSubCreatedButNotYetPublished) {
if (blocked) {
footerFirstLine = t('you_blocked_community');
} else {
footerFirstLine = t('no_posts');
}
} else if (feed.length === 0 && started && isSubCreatedButNotYetPublished) {
footerFirstLine = t('no_posts');
} else if (feed.length === 0 || !isOnline) {
footerFirstLine = loadingString;
} else if (hasMore) {
footerFirstLine = loadingString;
}
Expand Down

0 comments on commit b3773e7

Please sign in to comment.