Files
marketplaces/src/app/features/project-editor/sections/footer-section.component.scss

97 lines
2.1 KiB
SCSS
Raw Normal View History

feat(builder): visual footer builder with drag-and-drop columns Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> P0 user feedback: footer static pages were comma-separated text; no way to add extra phones/emails for different countries. - New FooterColumnConfig/FooterLinkConfig model (footer-config.model.ts): columns of links, each link pointing at an existing static page (resolved by key, so it survives route renames) or a custom URL - Footer Builder UI: add/remove columns and links, per-link toggle between 'existing page' (dropdown of real static pages) and 'custom URL', drag-and-drop reordering of both columns and links via @angular/cdk/drag-drop (same primitive already used by the homepage section builder) - Wired FooterResolverService (the service the real storefront footer actually renders through) to read footer.columns as the primary source when present - without this the builder would have saved data nobody ever displayed. Falls back to the existing legacy static-page auto-grouping when no columns are configured, so existing sites are unaffected - CompanyContactConfig gains additionalPhones/additionalEmails (primary phone/email field unchanged) with add/remove UI for country-specific support lines - Old comma-separated staticPageKeys input removed from the UI; field kept on the model as deprecated/read-compat only - New builder.* i18n keys (en/ru/hy); fixed an accidental duplicate-key collision with pre-existing navigation-section addLink/removeLink keys during the rename pass - Verified in browser: added column, added link, switched link source page->custom, added phone number - all reactive and error-free
2026-07-19 13:58:57 +04:00
.contact-row {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
app-input { flex: 1; }
}
.contact-row__remove {
border: none;
background: transparent;
cursor: pointer;
color: var(--text-secondary, #6b7280);
font-size: 1rem;
&:hover { color: var(--danger-color, #c0392b); }
}
.footer-columns {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin: 8px 0;
}
.footer-column {
display: grid;
gap: 8px;
width: 260px;
padding: 10px;
border: 1px solid var(--border-color, #d3dad9);
border-radius: var(--radius-sm);
background: var(--bg-secondary, #f7f8f8);
&.cdk-drag-preview { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
&.cdk-drag-placeholder { opacity: 0.4; }
}
.footer-column__head {
display: flex;
align-items: center;
gap: 6px;
app-input { flex: 1; }
}
.footer-column__grip { cursor: grab; color: var(--text-secondary, #6b7280); }
.footer-column__remove {
border: none;
background: transparent;
cursor: pointer;
color: var(--text-secondary, #6b7280);
font-size: 1rem;
&:hover { color: var(--danger-color, #c0392b); }
}
.footer-column__links {
display: grid;
gap: 6px;
min-height: 20px;
}
.footer-link {
display: grid;
grid-template-columns: auto 1fr auto;
grid-template-areas:
"grip label remove"
"source source source"
"target target target";
gap: 4px 6px;
align-items: center;
padding: 6px;
border: 1px solid var(--border-color, #d3dad9);
border-radius: var(--radius-sm);
background: #fff;
&.cdk-drag-preview { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
&.cdk-drag-placeholder { opacity: 0.4; }
}
.footer-link__grip { grid-area: grip; cursor: grab; color: var(--text-secondary, #6b7280); }
.footer-link app-input:first-of-type { grid-area: label; }
.footer-link__remove {
grid-area: remove;
border: none;
background: transparent;
cursor: pointer;
color: var(--text-secondary, #6b7280);
}
.footer-link__source { grid-area: source; }
.footer-link app-input[type="url"], .footer-link select:not(.footer-link__source) { grid-area: target; }
.cdk-drag-animating { transition: transform 200ms cubic-bezier(0, 0, 0.2, 1); }