Skip to content

Commit

Permalink
chore: cleanup and refactor class names
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Nov 19, 2024
1 parent 3ce5ab9 commit 2c8eef1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 34 deletions.
8 changes: 3 additions & 5 deletions src/components/layouts/FullPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ const FullPageLayout: React.FC<LayoutProps> = ({
loading = false,
poweredBy,
}) => {
const isChrome = navigator.userAgent.includes('Chrome');

return (
<>
{integrationStyle}
{integrationBackground}

<Spin className={`memori-full-body--container ${isChrome ? 'memori-full-body--container--chrome' : 'memori-full-body--container--safari'}`} spinning={loading}>
<Spin className="memori-full-body--container" spinning={loading}>
{showInstruct && ChangeMode && changeModeProps && (
<ChangeMode {...changeModeProps} />
)}
Expand All @@ -38,7 +36,7 @@ const FullPageLayout: React.FC<LayoutProps> = ({
</div>

<div className="memori--grid">
<div className="memori-full-body-layout--avatar-mobile memori--grid-column memori--grid-column-left">
<div className="memori-full-body-layout--avatar-column memori--grid-column memori--grid-column-left">
{Avatar && avatarProps && <Avatar {...avatarProps} />}

<div id="extension" />
Expand All @@ -51,7 +49,7 @@ const FullPageLayout: React.FC<LayoutProps> = ({
) : null}
</div>

<div className="memori--powered-by-custom">{poweredBy}</div>
<div className="memori--powered-by-container">{poweredBy}</div>
</div>
</Spin>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/components/layouts/ZoomedFullBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ZoomedFullBodyLayout: React.FC<LayoutProps> = ({
{integrationStyle}
{integrationBackground}

<Spin className={`memori-full-body--container`} spinning={loading}>
<Spin className="memori-full-body--container" spinning={loading}>
{showInstruct && ChangeMode && changeModeProps && (
<ChangeMode {...changeModeProps} />
)}
Expand All @@ -41,7 +41,7 @@ const ZoomedFullBodyLayout: React.FC<LayoutProps> = ({
</div>

<div className="memori--grid">
<div className="memori-full-body-layout--avatar-mobile memori--grid-column memori--grid-column-left ">
<div className="memori-full-body-layout--avatar-column memori--grid-column memori--grid-column-left ">
{Avatar && avatarProps && (
<Avatar chatProps={chatProps} isZoomed {...avatarProps} />
)}
Expand Down
6 changes: 3 additions & 3 deletions src/components/layouts/__snapshots__/FullPage.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports[`renders FullPage layout unchanged 1`] = `
/>
</div>
<div
class="memori-spin memori-full-body--container memori-full-body--container--safari"
class="memori-spin memori-full-body--container"
>
<div
class="memori-full-body--header"
Expand Down Expand Up @@ -129,7 +129,7 @@ exports[`renders FullPage layout unchanged 1`] = `
class="memori--grid"
>
<div
class="memori-full-body-layout--avatar-mobile memori--grid-column memori--grid-column-left"
class="memori-full-body-layout--avatar-column memori--grid-column memori--grid-column-left"
>
<div
class="memori--avatar-wrapper memori--avatar-readyplayerme"
Expand Down Expand Up @@ -394,7 +394,7 @@ exports[`renders FullPage layout unchanged 1`] = `
</div>
</div>
<div
class="memori--powered-by-custom"
class="memori--powered-by-container"
>
<div
class="memori--powered-by"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ exports[`renders ZOOMED_FULL_BODY layout unchanged 1`] = `
class="memori--grid"
>
<div
class="memori-full-body-layout--avatar-mobile memori--grid-column memori--grid-column-left "
class="memori-full-body-layout--avatar-column memori--grid-column memori--grid-column-left "
>
<div
class="memori--avatar-wrapper memori--avatar-readyplayerme"
Expand Down
14 changes: 7 additions & 7 deletions src/components/layouts/layouts.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
}


.memori--powered-by-custom {
.memori--powered-by-container {
top: 30px !important;
bottom: auto;
left: 30px;
}

/* Avatar */
.memori-full-body-layout--avatar-mobile {
.memori-full-body-layout--avatar-column {
position: fixed;
z-index: 0;
top: 0;
Expand All @@ -35,7 +35,7 @@
touch-action: pan-y pinch-zoom;
}

.memori-full-body-layout--avatar-mobile .memori--avatar-wrapper > div {
.memori-full-body-layout--avatar-column .memori--avatar-wrapper > div {
overflow: visible !important;
width: auto !important;
height: 80vh !important;
Expand All @@ -45,23 +45,23 @@
will-change: transform;
}

.memori-full-body-layout--avatar-mobile .memori--avatar-wrapper canvas {
.memori-full-body-layout--avatar-column .memori--avatar-wrapper canvas {
width: auto !important;
max-width: 100%;
height: 100% !important;
max-height: 100%;
touch-action: none;
}

.memori-full-body-layout--avatar-mobile .memori--avatar-wrapper > div canvas + div,
.memori-full-body-layout--avatar-mobile .memori--avatar-wrapper .avatar-loader {
.memori-full-body-layout--avatar-column .memori--avatar-wrapper > div canvas + div,
.memori-full-body-layout--avatar-column .memori--avatar-wrapper .avatar-loader {
position: absolute !important;
width: 100%;
height: 100%;
transform: none !important;
}

.memori-full-body-layout--avatar-mobile .memori--avatar-wrapper .avatar-loader {
.memori-full-body-layout--avatar-column .memori--avatar-wrapper .avatar-loader {
display: flex;
align-items: center;
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/zoomed-full-body.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
touch-action: manipulation;
}

.memori--powered-by-custom {
.memori--powered-by-container {
position: absolute;
z-index: 1000;
bottom: 50px;
Expand Down
17 changes: 3 additions & 14 deletions src/components/ui/Spin.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,8 @@

@media (max-width: 870px) {

.memori-spin--spinning {
top: 60% !important;
left: 110%;
font-size: 1rem;
}

.memori-spin--spinner {
margin: auto;
background: transparent ;
}

.memori-spin--spinner svg {
width: 20%;
height: 20%;
.memori-spin--spinner svg {
max-width: 3rem;
max-height: 3rem;
}
}
3 changes: 2 additions & 1 deletion src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
@import url('./components/layouts/chat.css');
@import url('./components/layouts/zoomed-full-body.css');

/* Default layout style */
/* General layout styles */
@import url('./components/layouts/layouts.css');

@import url('https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css');

.sr-only {
Expand Down

0 comments on commit 2c8eef1

Please sign in to comment.