Skip to content

Commit

Permalink
🌈 Design: 구조 요청 모달 상세보기 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoRaang committed Dec 8, 2024
1 parent ffcaa57 commit fe14007
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 47 deletions.
35 changes: 35 additions & 0 deletions src/assets/stylesheets/layouts/_commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,41 @@ a:has(#logo-primary) {
opacity: 0.5;
}

.user-common-table {
// 데이터 테이블
display: flex;
flex-flow: column nowrap;
gap: 1px;
padding-block: 1px;
background-color: rgb(var(--clr-text) / 0.15);
}

.user-common-table-row {
display: flex;
height: 1.8rem;
font-size: var(--fnt-sm);
background-color: rgb(var(--clr-white));
}

.user-common-table-row-header {
flex-shrink: 0;
display: flex;
justify-content: flex-end;
align-items: center;
padding-inline: 0.8rem;
width: 6.4rem;
background-color: rgb(var(--clr-tint-100) / 0.05);
font-weight: 200;
}

.user-common-table-row-cell {
flex: 1;
display: flex;
align-items: center;
padding-inline: 0.8rem;
font-weight: 700;
}

.floating-tooltip {
// 툴팁
--bubble-color: var(--clr-text);
Expand Down
47 changes: 45 additions & 2 deletions src/assets/stylesheets/pages/_rescueInfo.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,66 @@
/* _rescueInfo.scss */

#rescue-found-situation {
font-weight: 700;
line-height: 1.4;
}

.rescue-disclaimer-block {
display: flex;
flex-flow: column nowrap;
gap: 0.4rem;

h6 {
font-size: var(--fnt-xl);
font-size: var(--fnt-lg);
font-weight: 700;
}

p {
font-weight: 200;
line-height: 1.4;
opacity: 0.5;

& + p {
margin-block-start: 0.2rem;
}
}
}

.list-animal-organizations {
display: flex;
flex-flow: column nowrap;
gap: 0.2rem;
}

.user-common-labeled-row {
display: flex;
align-items: center;
height: 1.6rem;
border: 1px solid rgb(var(--clr-text) / 0.15);
border-radius: var(--rad-full);
font-size: var(--fnt-sm);
overflow: clip;

> dt,
> dd {
display: flex;
align-items: center;
padding-inline: 0.8rem;
height: 100%;
}

> dt {
flex-shrink: 0;
justify-content: center;
width: 6.4rem;
background-color: rgb(var(--clr-info) / 0.05);
font-weight: 200;
}

> dd {
flex: 1;
border-inline-start: 1px solid rgb(var(--clr-text) / 0.15);
font-weight: 700;
}
}

/* _rescueInfo.scss */
78 changes: 76 additions & 2 deletions src/assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,40 @@ a:has(#logo-primary) {
opacity: 0.5;
}

.user-common-table {
display: flex;
flex-flow: column nowrap;
gap: 1px;
padding-block: 1px;
background-color: rgb(var(--clr-text)/0.15);
}

.user-common-table-row {
display: flex;
height: 1.8rem;
font-size: var(--fnt-sm);
background-color: rgb(var(--clr-white));
}

.user-common-table-row-header {
flex-shrink: 0;
display: flex;
justify-content: flex-end;
align-items: center;
padding-inline: 0.8rem;
width: 6.4rem;
background-color: rgb(var(--clr-tint-100)/0.05);
font-weight: 200;
}

.user-common-table-row-cell {
flex: 1;
display: flex;
align-items: center;
padding-inline: 0.8rem;
font-weight: 700;
}

.floating-tooltip {
--bubble-color: var(--clr-text);
position: absolute;
Expand Down Expand Up @@ -1711,23 +1745,63 @@ a:has(#logo-primary) {

/* _missingReport.scss */
/* _rescueInfo.scss */
#rescue-found-situation {
font-weight: 700;
line-height: 1.4;
}

.rescue-disclaimer-block {
display: flex;
flex-flow: column nowrap;
gap: 0.4rem;
}
.rescue-disclaimer-block h6 {
font-size: var(--fnt-xl);
font-size: var(--fnt-lg);
font-weight: 700;
}
.rescue-disclaimer-block p {
font-weight: 200;
line-height: 1.4;
opacity: 0.5;
}
.rescue-disclaimer-block p + p {
margin-block-start: 0.2rem;
}

.list-animal-organizations {
display: flex;
flex-flow: column nowrap;
gap: 0.2rem;
}

.user-common-labeled-row {
display: flex;
align-items: center;
height: 1.6rem;
border: 1px solid rgb(var(--clr-text)/0.15);
border-radius: var(--rad-full);
font-size: var(--fnt-sm);
overflow: clip;
}
.user-common-labeled-row > dt,
.user-common-labeled-row > dd {
display: flex;
align-items: center;
padding-inline: 0.8rem;
height: 100%;
}
.user-common-labeled-row > dt {
flex-shrink: 0;
justify-content: center;
width: 6.4rem;
background-color: rgb(var(--clr-info)/0.05);
font-weight: 200;
}
.user-common-labeled-row > dd {
flex: 1;
border-inline-start: 1px solid rgb(var(--clr-text)/0.15);
font-weight: 700;
}

/* _rescueInfo.scss */
/* _buttons.scss */
button {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ChatItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import hourFormat from '../../utils/hourFormat';
const ChatItem = ({
chatFrom = 'my', // my, opposite
chatUser = { userID: 0, userImage: null, userName: '대화 상대' },
chatContent = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas laboriosam, debitis veniam nobis eligendi sequi modi deleniti repellat harum aliquid possimus, repellendus, quisquam voluptatem! Exercitationem voluptas dolorem natus architecto laborum.',
chatContent = '주고받은 대화 내용',
dateTime = '1970-01-01',
isRead = true,
}) => {
Expand Down
13 changes: 13 additions & 0 deletions src/components/common/DataTableRow.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const DataTableRow = ({ tableHeader, children }) => {
return (
<dl className="user-common-table-row">
<dt className="user-common-table-row-header">
<span>{tableHeader ?? '헤더'}</span>
</dt>

<dd className="user-common-table-row-cell">{children}</dd>
</dl>
);
};

export default DataTableRow;
90 changes: 51 additions & 39 deletions src/components/common/ImageGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,58 @@ import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';

const ImageGallery = () => {
const images = [
{
src: Image1,
alt: '정신차려 갤러리 이미지 1',
width: 1200,
height: 800,
},
{
src: Image2,
alt: '정신차려 갤러리 이미지 2',
width: 800,
height: 600,
},
{
src: Image3,
alt: '정신차려 갤러리 이미지 3',
width: 1600,
height: 900,
},
{
src: Image4,
alt: '정신차려 갤러리 이미지 4',
width: 1024,
height: 768,
},
{
src: Image4,
alt: '정신차려 갤러리 이미지 4',
width: 1024,
height: 768,
},
{
src: Image4,
alt: '정신차려 갤러리 이미지 4',
width: 1024,
height: 768,
},
];
const images = [
{
src: Image1,
alt: '정신차려 갤러리 이미지 1',
width: 1200,
height: 800,
},
{
src: Image2,
alt: '정신차려 갤러리 이미지 2',
width: 800,
height: 600,
},
{
src: Image3,
alt: '정신차려 갤러리 이미지 3',
width: 1600,
height: 900,
},
{
src: Image4,
alt: '정신차려 갤러리 이미지 4',
width: 1024,
height: 768,
},
{
src: Image4,
alt: '정신차려 갤러리 이미지 4',
width: 1024,
height: 768,
},
{
src: Image4,
alt: '정신차려 갤러리 이미지 4',
width: 1024,
height: 768,
},
];

const ImageSlideItem = (imageObject, index) => {
<SwiperSlide key={`gallery-image-${index}`} className="gallery-slide">
<a
href={imageObject.src}
data-pswp-width={imageObject.width}
data-pswp-height={imageObject.height}
>
<img src={imageObject.src} alt={imageObject.alt} />
</a>
</SwiperSlide>;
};

const ImageGallery = () => {
useEffect(() => {
const lightbox = new PhotoSwipeLightbox({
gallery: '#gallery--getting-started',
Expand Down
52 changes: 50 additions & 2 deletions src/pages/RescueDetails.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
const RescueDetails = () => {
return <div>sadfsdf</div>;
import DataTableRow from '../components/common/DataTableRow';
import ModalSectionTitle from '../components/common/ModalSectionTitle';
import dateFormat from '../utils/dateFormat';
import hourFormat from '../utils/hourFormat';
import tempDB from '../datas/temp-db.json';
import ImageGallery from '../components/common/ImageGallery';

const RescueDetails = ({ threadID = 0 }) => {
const currentThread = tempDB.threads[threadID];
const rescueInfo = currentThread.rescueInfo;

console.log(currentThread);

return (
<>
<div className="user-common-item-list">
<ImageGallery />

<div>이미지 슬라이더 들어갈 자리</div>
</div>

<ModalSectionTitle sectionTitle="요구조 동물 정보" />

<div id="rescue-found-situation" className="user-common-item-list">
{rescueInfo.foundSituation}
</div>

<div className="user-common-table">
<DataTableRow tableHeader={'동물 종류 / 품종'}>
<span>{rescueInfo.animalType}</span>
</DataTableRow>

<DataTableRow tableHeader={'위치'}>
<span>
{currentThread.address1
? currentThread.address1
: '주소 없음'}
</span>
</DataTableRow>

<DataTableRow tableHeader={'발견일시'}>
<span>{dateFormat(rescueInfo.foundAt)}</span>

<span>/</span>

<span>{hourFormat(rescueInfo.foundAt)}</span>
</DataTableRow>
</div>
</>
);
};

export default RescueDetails;
Loading

0 comments on commit fe14007

Please sign in to comment.