Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): update list starter for correct styles and back button text #1856

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions react-vite/official/list/src/components/MessageListItem.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
ion-item {
#message-list-item {
--padding-start: 0;
--inner-padding-end: 0;
}

ion-label {
#message-list-item ion-label {
margin-top: 12px;
margin-bottom: 12px;

overflow: hidden;
}

ion-item h2 {
#message-list-item ion-label h2 {
font-weight: 600;
margin: 0;

/**
* With larger font scales
* the date/time should wrap to the next
Expand All @@ -24,33 +26,31 @@ ion-item h2 {
justify-content: space-between;
}

ion-item p {
text-overflow: ellipsis;
overflow: hidden;
#message-list-item p {
white-space: nowrap;
width: 95%;
}

ion-item .date {
#message-list-item .date {
align-items: center;
display: flex;
}

ion-item ion-icon {
#message-list-item ion-icon {
color: #c9c9ca;
}

ion-item ion-note {
#message-list-item ion-note {
font-size: 0.9375rem;
margin-right: 8px;
font-weight: normal;
}

ion-item ion-note.md {
#message-list-item ion-note.md {
margin-right: 14px;
}

.dot {
#message-list-item .dot {
display: block;
height: 12px;
width: 12px;
Expand All @@ -59,11 +59,6 @@ ion-item ion-note.md {
margin: 16px 10px 16px 16px;
}

.dot-unread {
#message-list-item .dot-unread {
background: var(--ion-color-primary);
}

ion-footer ion-title {
font-size: 11px;
font-weight: normal;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface MessageListItemProps {

const MessageListItem: React.FC<MessageListItemProps> = ({ message }) => {
return (
<IonItem routerLink={`/message/${message.id}`} detail={false}>
<IonItem id="message-list-item" routerLink={`/message/${message.id}`} detail={false}>
<div slot="start" className="dot dot-unread"></div>
<IonLabel className="ion-text-wrap">
<h2>
Expand Down
8 changes: 7 additions & 1 deletion react/official/list/src/pages/ViewMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
IonPage,
IonToolbar,
useIonViewWillEnter,
isPlatform
} from '@ionic/react';
import { personCircle } from 'ionicons/icons';
import { useParams } from 'react-router';
Expand All @@ -27,12 +28,17 @@ function ViewMessage() {
setMessage(msg);
});

const getBackButtonText = () => {
const isIos = isPlatform('ios')
return isIos ? 'Inbox' : '';
};

return (
<IonPage id="view-message-page">
<IonHeader translucent>
<IonToolbar>
<IonButtons slot="start">
<IonBackButton text="Inbox" defaultHref="/home"></IonBackButton>
<IonBackButton text={getBackButtonText()} defaultHref="/home"></IonBackButton>
</IonButtons>
</IonToolbar>
</IonHeader>
Expand Down