Company is a Profile-tab reusable for B2B customers that:Components/Profile/Default.liquid (tab company):{% render 'Reusables\\Company\\Default',
headQuarterAddress: headQuarterAddress,
branches: branches,
companyLogoUrl: companyLogoUrl
%}Company is rendered with named parameters.Profile component model dump containing the fields passed to this reusable.{
"companyLogoUrl": "",
"headQuarterAddress": {
"addressName": "Sample name",
"address1": "Sample address",
"city": "Sample city",
"postalCode": "11147",
"state": "Sample state",
"country": "Sample country",
"phoneNumber": "Sample phone",
"email": "sample@example.com",
"tin": "Sample TIN",
"taxOffice": "Sample tax office"
},
"branches": [
{
"addressName": "Sample branch name",
"address1": "Sample address",
"city": "Sample city",
"postalCode": "54321",
"state": "Sample state",
"country": "Sample country",
"phoneNumber": "Sample phone"
},
...
],
"translations": {
"company": "Sample text",
"orders": "Sample text",
"addresses": "Sample text",
"...": "..."
}
}companyLogoUrl (string)headQuarterAddress (object | null)addressName, address1, city, postalCode, state, countrytin, taxOffice, phoneNumber, email (optional)branches (array | null)addressName, address1, city, postalCode, state, country, phoneNumber (optional)Reusables/Company/Default.liquid.x-data="companyreusabledefault.initComponent('{{ companyLogoUrl }}')"src:companyLogoUrl when presentAssets/images/no-company-logo.jpg<img> is also bound to Alpine so the preview updates immediately after selecting a file::src="companyLogoUrl || '{{GlobalData.RootPath}}/Assets/images/no-company-logo.jpg'"<input type="file"> with @change="handleLogoUpload".@click="handleSaveLogo('{{ GlobalData.User.CustomerId }}', '{{ Reusables.Company.Translations.SaveCompanyLogoErrorMessage }}')"@click='handleDeleteModal({{ modalTranslations }})'modalTranslations is a JSON string assembled in Liquid from translation keys.headQuarterAddress is present.branches exists and branches.size > 0.companyreusabledefault.initComponent(companyLogoUrl)Reusables/Company/Default.js.companyLogoUrl (string)loading (boolean)tempImageChanged / imageChanged (booleans)logoFile (File | null)Reusables/Company/Default.js.handleLogoUpload(event)event.target.files[0]).this.companyLogoUrl = window.URL.createObjectURL(this.logoFile);tempImageChanged = true) so the Save button becomes enabled.handleSaveLogo(customerId, errorMessage)loading = true.servicesreusabledefault.uploadCompanyLogo(this.logoFile, customerId)errorMessage).?t=<timestamp>).handleDeleteModal(modalTranslations)$store.modal with two buttons:handleDeleteLogo(modalTranslations.errorMessage)handleDeleteLogo(errorMessage)servicesreusabledefault.deleteCompanyLogo()companyLogoUrl and closes the modal.Company JS:$store.toastremoveAll() and add(...) for error reporting.$store.modalopen(...) and close() for the delete-confirmation modal.Reusables/Company/Default.js:servicesreusabledefault.uploadCompanyLogo(file, customerId)servicesreusabledefault.deleteCompanyLogo()Reusables/Company/Default.liquidReusables/Company/Default.jsReusables/Company/Default.json (translations)Components/Profile/Default.liquid (render site)$store.toast and $store.modal (defined in Assets/js/theme.js)servicesreusabledefault.uploadCompanyLogo / servicesreusabledefault.deleteCompanyLogoGlobalData.User.CustomerId (in Liquid) when saving the logo; this is not part of the reusable inputs.tempImageChanged = true).{% render 'Reusables\\Company\\Default',
headQuarterAddress: headQuarterAddress,
branches: branches,
companyLogoUrl: companyLogoUrl
%}