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

Contact app mobile #752

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
83f74c3
feat(mobile contacts): implement mobile view card and routes for hous…
RyanMG Mar 11, 2025
0c20082
feat(mobile contacts): implement first pass mobile contacts listing UI
RyanMG Mar 11, 2025
d3ae54f
chore: remove previously created mobile contacts example out of /src/…
RyanMG Mar 11, 2025
bba655e
chore: previous mobile contacts app code now placed in new /examples/…
RyanMG Mar 11, 2025
2d77257
ui: copy over favorite button SCSS file
RyanMG Mar 12, 2025
aa19fd2
Merge branch 'develop' into contact-app-mobile
RyanMG Mar 12, 2025
f098783
fix: entry point app name change contactMobile -> mobileContacts
RyanMG Mar 12, 2025
4df8677
feat(mobile contacts): hide / show contact details
RyanMG Mar 12, 2025
1e1a5f8
feat(mobile contacts): clear grid / tile selection when the details …
RyanMG Mar 12, 2025
8aa46fd
ui(mobile contacts): contact details animate properly in and out
RyanMG Mar 12, 2025
f03878b
fix(mobile contacts): explicit height on content details to allow scr…
RyanMG Mar 12, 2025
ccc571a
feat(mobile contacts): implement contact details bottom bar
RyanMG Mar 12, 2025
79768c8
ui(mobile contacts): add contact data into ui
RyanMG Mar 12, 2025
f8c2574
feat(mobile contacts): persist user favorites in localstorage
RyanMG Mar 12, 2025
4bf46b0
ui(mobile contacts): CSS cleanup
RyanMG Mar 12, 2025
b344237
refactor(mobile contacts): better semantic name for entrypoint
RyanMG Mar 12, 2025
4104855
chore(mobile contacts): remove contact service code bootstrapped into…
RyanMG Mar 13, 2025
e0fc1fb
ui(mobile contacts): styling pattern adjustments / comments
RyanMG Mar 13, 2025
8f4f800
feat(mobile contacts): replace localstorage favorites with DB persist…
RyanMG Mar 13, 2025
45d7a4e
feat(mobile contacts): TODO cleanups
RyanMG Mar 13, 2025
5ea7796
feat(mobile contacts): grid view grouping
RyanMG Mar 13, 2025
6b0ada2
refactor(mobile contacts): nest mobile and desktop under "contact" pa…
RyanMG Mar 14, 2025
75e2192
Merge branch 'develop' into contact-app-mobile
TomTirapani Mar 26, 2025
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
Prev Previous commit
Next Next commit
feat(mobile contacts): hide / show contact details
 - details page is by defaul flex none and width 0
 - selecting an option adds a class to show the details
 - X button added to details header which removes the class and hides the details
  • Loading branch information
RyanMG committed Mar 12, 2025
commit 4df86775ea9fd28ee12f873f986d3c589ce41d41

This file was deleted.

Original file line number Diff line number Diff line change
@@ -17,8 +17,6 @@ export const contactsPage = hoistCmp.factory({

render({model}) {
return panel({
title: 'XH Contact Mobile',
icon: Icon.addressCard(),
item: hframe(
panel({
tbar: tbar(),
Original file line number Diff line number Diff line change
@@ -9,6 +9,9 @@ import './FavoriteButton.scss';
export const favoriteButton = hoistCmp.factory<ContactsPageModel>(({model, record}) => {
const {isFavorite} = record.data;
return button({
className: 'tb-contact-fave-btn',
height: null,
style: {backgroundColor: 'transparent'},
icon: Icon.favorite({
color: isFavorite ? 'gold' : null,
prefix: isFavorite ? 'fas' : 'far'
Original file line number Diff line number Diff line change
@@ -39,9 +39,7 @@ const tile = hoistCmp.factory<ContactsPageModel>(({model, record}) => {
]
})
],
onClick: () => {
gridModel.selectAsync(record);
}
onClick: () => gridModel.selectAsync(record)
});
});

41 changes: 41 additions & 0 deletions client-app/src/examples/mobileContacts/details/ContactDetails.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.tb-mobile-contact-details-panel {
flex: none;
width: 0;

&.details-visible {
flex: 1;
width: 100%;
}

.xh-panel-header {
height: 41px;
}

&__inner {
flex: 1;
overflow-y: auto;

img {
display: table-cell;
height: 250px;
margin: var(--xh-pad-px) auto;
}

.xh-form-field {
margin: 0;
padding: var(--xh-pad-half-px) var(--xh-pad-px);

&:first-of-type {
border-top: var(--xh-border-solid);
}

&:not(:last-child) {
border-bottom: var(--xh-border-solid);
}
}

.xh-form-field-label {
font-weight: bold;
}
}
}
Original file line number Diff line number Diff line change
@@ -2,18 +2,26 @@ import {hoistCmp, uses} from '@xh/hoist/core';
import {box, div, img, p} from '@xh/hoist/cmp/layout';
import {formField} from '@xh/hoist/mobile/cmp/form';
import {form} from '@xh/hoist/cmp/form';
import {panel} from '@xh/hoist/mobile/cmp/panel';
import {select, textArea, textInput} from '@xh/hoist/mobile/cmp/input';
import {button} from '@xh/hoist/mobile/cmp/button';
import {Icon} from '@xh/hoist/icon';
import {isEmpty} from 'lodash';

import ContactDetailsModel from './ContactDetailsModel';
import './ContactDetails.scss';

export const contactDetails = hoistCmp.factory({
model: uses(ContactDetailsModel),
render({model}) {
const {currentRecord} = model;
const {currentRecord, visible} = model;

return div({
className: 'tb-contact-details-panel__inner',
return panel({
className: `tb-mobile-contact-details-panel ${visible ? 'details-visible' : ''}`,
flex: 'none',
width: 'none',
title: currentRecord?.data.name,
headerItems: [button({icon: Icon.close(), onClick: () => (model.visible = false)})],
item: currentRecord ? contactProfile() : null
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {HoistModel} from '@xh/hoist/core/model/HoistModel';
import {FormModel} from '@xh/hoist/cmp/form';
import {managed} from '@xh/hoist/core';
import {bindable, makeObservable, observable, action} from '@xh/hoist/mobx';
import {StoreRecord} from '@xh/hoist/data';
import {required} from '@xh/hoist/data/validation/constraints';

import ContactsPageModel from '../ContactsPageModel';

export default class ContactDetailsModel extends HoistModel {
@observable.ref
currentRecord: StoreRecord;

@bindable visible: boolean = false;

contactPageModel: ContactsPageModel;

@managed
formModel: FormModel;

constructor(contactPageModel: ContactsPageModel) {
super();
makeObservable(this);
this.contactPageModel = contactPageModel;

this.formModel = new FormModel({
readonly: true,
fields: [
{name: 'name', rules: [required]},
{name: 'email', rules: [required]},
{name: 'location', rules: [required]},
{name: 'workPhone'},
{name: 'cellPhone'},
{name: 'bio'},
{name: 'tags'}
]
});
}

@action
setCurrentRecord(record) {
this.currentRecord = record;
this.formModel.init(record?.data);
this.visible = true;
}
}