Skip to content

Commit d266be3

Browse files
committed
Make navigation style for smaller phones
1 parent 7c2cc93 commit d266be3

File tree

1 file changed

+100
-2
lines changed

1 file changed

+100
-2
lines changed

src/app/pages/profile/profile.component.ts

+100-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ interface MediaItem {
7676
</section>
7777
7878
<div class="container">
79-
<div class="tabs">
79+
<div class="tabs" [class.mobile]="isMobile">
8080
<button
8181
*ngFor="let tab of tabs"
8282
[class.active]="activeTab === tab.id"
@@ -430,6 +430,21 @@ interface MediaItem {
430430
</div>
431431
</div>
432432
</div>
433+
434+
<div *ngIf="isMobile" class="mobile-navigation">
435+
<button
436+
class="nav-button previous"
437+
(click)="previousTab()"
438+
*ngIf="activeTab !== tabs[0].id">
439+
← Previous
440+
</button>
441+
<button
442+
class="nav-button next"
443+
(click)="nextTab()"
444+
*ngIf="activeTab !== tabs[tabs.length-1].id">
445+
Next →
446+
</button>
447+
</div>
433448
</div>
434449
435450
<div class="actions">
@@ -492,6 +507,67 @@ interface MediaItem {
492507
background: var(--accent);
493508
}
494509
510+
.tabs.mobile {
511+
flex-wrap: wrap;
512+
justify-content: center;
513+
gap: 0.5rem;
514+
}
515+
516+
.tabs.mobile button {
517+
font-size: 0.9rem;
518+
padding: 0.5rem 1rem;
519+
}
520+
521+
@media (max-width: 768px) {
522+
.tabs {
523+
display: none;
524+
}
525+
526+
.profile-section {
527+
margin: 1rem;
528+
padding: 1rem;
529+
}
530+
531+
.mobile-navigation {
532+
display: flex;
533+
justify-content: space-between;
534+
gap: 1rem;
535+
margin-top: 2rem;
536+
padding: 0 1rem;
537+
}
538+
539+
.nav-button {
540+
padding: 0.75rem 1.5rem;
541+
background: var(--surface-card);
542+
border: 1px solid var(--border);
543+
border-radius: 4px;
544+
color: var(--text);
545+
cursor: pointer;
546+
transition: all 0.2s ease;
547+
}
548+
549+
.nav-button:hover {
550+
background: var(--surface-hover);
551+
transform: translateY(-1px);
552+
}
553+
554+
.nav-button.previous {
555+
padding-left: 1rem;
556+
}
557+
558+
.nav-button.next {
559+
padding-right: 1rem;
560+
}
561+
}
562+
563+
/* Add current step indicator for mobile */
564+
.mobile-step-indicator {
565+
text-align: center;
566+
color: var(--text-secondary);
567+
margin: 1rem 0;
568+
font-size: 0.9rem;
569+
}
570+
495571
.profile-section {
496572
background: var(--surface-card);
497573
padding: 2rem;
@@ -778,7 +854,7 @@ interface MediaItem {
778854
779855
.add-link-button:hover {
780856
background: var(--surface-hover);
781-
border-color: var(--accent);
857+
border-color: var (--accent);
782858
color: var(--accent);
783859
}
784860
@@ -972,9 +1048,31 @@ export class ProfileComponent implements OnInit {
9721048
relays: string[] = [];
9731049
newRelayUrl = '';
9741050

1051+
isMobile = false;
1052+
9751053
constructor() {
9761054
// Initialize with empty states
9771055
this.addFaqItem();
1056+
this.checkScreenSize();
1057+
window.addEventListener('resize', () => this.checkScreenSize());
1058+
}
1059+
1060+
private checkScreenSize() {
1061+
this.isMobile = window.innerWidth < 768;
1062+
}
1063+
1064+
nextTab() {
1065+
const currentIndex = this.tabs.findIndex(tab => tab.id === this.activeTab);
1066+
if (currentIndex < this.tabs.length - 1) {
1067+
this.activeTab = this.tabs[currentIndex + 1].id;
1068+
}
1069+
}
1070+
1071+
previousTab() {
1072+
const currentIndex = this.tabs.findIndex(tab => tab.id === this.activeTab);
1073+
if (currentIndex > 0) {
1074+
this.activeTab = this.tabs[currentIndex - 1].id;
1075+
}
9781076
}
9791077

9801078
trackByIndex(index: number, item: any): number {

0 commit comments

Comments
 (0)