Skip to content

Commit

Permalink
Merge branch 'slavaD'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokrip committed Feb 3, 2025
2 parents 5cf0f05 + c521712 commit 8eb382b
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 17 deletions.
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class


# Django-specific files
*.log
*.pot
*.pyc
*.pyo

# Database
*.sqlite3
*.db

# Media/uploads
media/

# Cache
*.cache


# IDE and Editor specific files
.vscode/
.idea/
*.sublime-project
*.sublime-workspace


# Celery and task queue files
celerybeat-schedule
celerybeat.pid

# pipenv / poetry
Pipfile.lock
poetry.lock

# dependencies
/node_modules
/.pnp
Expand Down
Binary file modified server/core/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified server/core/utils/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified server/core/utils/__pycache__/collections.cpython-312.pyc
Binary file not shown.
Binary file modified server/core/utils/__pycache__/misc.cpython-312.pyc
Binary file not shown.
Binary file modified server/core/utils/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file modified server/db.sqlite3
Binary file not shown.
Binary file modified server/migrations/__pycache__/0001_initial.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file modified server/models/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified server/models/__pycache__/customers.cpython-312.pyc
Binary file not shown.
Binary file modified server/settings/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified server/urls/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions src/app/api/v1/header/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from "path"
async function getHeaderData() {
try {
// Путь к файлу headerMenu.json
const filePath = path.join(process.cwd(), "src", "config", "data", "headerMenu.json");
const filePath = path.join(process.cwd(), "src", "core", "data", "headerMenu.json");

// Чтение файла
const fileContents = await fs.readFile(filePath, "utf-8");
Expand All @@ -24,4 +24,4 @@ export const GET = async () => {
} catch(error) {
return NextResponse.json({error})
}
}
}
2 changes: 1 addition & 1 deletion src/app/html.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClassNameType } from "@/types/react.type";
import "./globals.scss";
import Providers from "@/config/providers/Providers";
import Providers from "@/core/providers/Providers";


export default function MainHtml({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,10 @@ const PaginationInfiniteScrolling = <
))}
</div>

{hasMoreData() ? (
{hasMoreData() && (
<div className='product-card-skeleton-list'>
<SkeletonProductCard />
<SkeletonProductCard row={1} />
</div>
) : (
<span className="text-center block p-10">No more posts</span>
)}
</>
);
Expand Down
85 changes: 75 additions & 10 deletions src/components/ui/elements/skeleton/SkeletonProductCard.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,79 @@
import {FC} from 'react';
import React, { Fragment } from 'react'
import ContentLoader from 'react-content-loader'

import styles from './SkeletonCard.module.scss';
import ContentLoader from 'react-content-loader';
const SkeletonProductCard = ({
width = 1366,
heading = { width: 140, height: 24 },
row = 2,
column = 6,
padding = 12,
borderRadius = 4,
...props
}) => {
const list = []

interface SkeletonCardProps {}
let height

const SkeletonProductCard: FC<SkeletonCardProps> = ({...props}) => {
return (

);
};
for (let i = 1; i <= row; i++) {
for (let j = 0; j < column; j++) {
const itemWidth = (width - padding * (column + 1)) / column

export default SkeletonProductCard;
const x = padding + j * (itemWidth + padding)

const height1 = itemWidth

const height2 = 20

const height3 = 20

const space =
padding + height1 + (padding / 2 + height2) + height3 + padding * 4

const y1 = padding + heading.height + padding * 2 + space * (i - 1)

const y2 = y1 + padding + height1

const y3 = y2 + padding / 2 + height2

list.push(
<Fragment key={`${i}-${j}`}>
<rect
x={x}
y={y1}
rx={borderRadius}
ry={borderRadius}
width={itemWidth}
height={height1}
/>
<rect x={x} y={y2} rx={0} ry={0} width={itemWidth} height={height2} />
<rect
x={x}
y={y3}
rx={0}
ry={0}
width={itemWidth * 0.6}
height={height3}
/>
</Fragment>
)

if (i === row) {
height = y3 + height3
}
}
}

return (
<ContentLoader
viewBox={`0 0 ${width} ${height}`}
width={width}
height={height}
{...props}
uniqueKey="product-list-card-skeleton"
>
{list}
</ContentLoader>
)
}

export default SkeletonProductCard
File renamed without changes.
File renamed without changes.

0 comments on commit 8eb382b

Please sign in to comment.