Skip to content

Commit

Permalink
Removed AvatarGroup component from Scanlist
Browse files Browse the repository at this point in the history
  • Loading branch information
bryandino673 committed Apr 27, 2024
1 parent c58af42 commit b32f101
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 27 deletions.
5 changes: 4 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
lint-staged
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"typedoc": "typedoc",
"prepare": "husky",
"prepare": "husky && husky install",
"eslint": "eslint --fix .",
"prettier": "prettier --write ."
},
Expand All @@ -35,7 +35,7 @@
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"husky": "^9.0.11",
"husky": "^8.0.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"sass": "^1.75.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function App(): JSX.Element {
<Routes>
<Route path="/" element={<Homepage />} />
<Route path="/login" element={<UserLogin />} />
<Route path="/Scanview" element={<ScanViewer />} />
<Route path="/ScanView" element={<ScanViewer />} />
</Routes>
</Router>
);
Expand Down
16 changes: 0 additions & 16 deletions src/components/ScanList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,17 @@ import React from 'react';

interface ScanData {
title: string;
avatarGroup: string[];
rawData: string;
}

interface ScanListProps {
scans: ScanData[];
}

const AvatarGroup: React.FC<{ avatarGroup: string[] }> = ({ avatarGroup }) => (
<div className="avatar-group">
{avatarGroup.map((avatar, index) => (
<img
key={index}
src={avatar}
alt={`Avatar ${index}`}
className="avatar"
/>
))}
</div>
);

const ScanList: React.FC<ScanListProps> = ({ scans }) => (
<div className="scan-list">
{scans.map((scan, index) => (
<div key={index} className="scan-item">
<h3>{scan.title}</h3>
<AvatarGroup avatarGroup={scan.avatarGroup} />
<p>{scan.rawData.substring(0, 50)}...</p>
</div>
))}
Expand Down
2 changes: 0 additions & 2 deletions src/components/ScanViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ const ScanViewer: React.FC = () => {
const scans = [
{
title: 'Scan 1',
avatarGroup: ['avatar1.jpg', 'avatar2.jpg', 'avatar3.jpg'],
rawData: 'Raw data...',
},
{
title: 'Scan 2',
avatarGroup: ['avatar4.jpg', 'avatar5.jpg', 'avatar6.jpg'],
rawData: 'Raw data...',
},
// Add more scan objects as needed
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3189,10 +3189,10 @@ human-signals@^5.0.0:
resolved "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz"
integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==

husky@^9.0.11:
version "9.0.11"
resolved "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz"
integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==
husky@^8.0.0:
version "8.0.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

ignore@^5.2.0, ignore@^5.3.1:
version "5.3.1"
Expand Down Expand Up @@ -3596,7 +3596,7 @@ lines-and-columns@^1.1.6:

lint-staged@^15.2.2:
version "15.2.2"
resolved "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-15.2.2.tgz#ad7cbb5b3ab70e043fa05bff82a09ed286bc4c5f"
integrity sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==
dependencies:
chalk "5.3.0"
Expand Down

0 comments on commit b32f101

Please sign in to comment.