-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from PiotrTyrakowski/server-piotr
Server piotr
- Loading branch information
Showing
7 changed files
with
112 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import smile from '../icons/smile.svg'; | ||
import sad from '../icons/sad.svg'; | ||
import Image from 'next/image'; | ||
|
||
const Card = ({ image, waga, godzina, data, face }) => { | ||
return ( <> | ||
<div className="bg-white rounded-lg p-4 mb-4 shadow-md items-center" style={{ width: '350px', height: '150px' }}> | ||
<div> | ||
<p className="text-black">{data}</p> | ||
</div> | ||
<div className="w-full h-full flex"> | ||
{/* Left side: Image */} | ||
<div className="w-1/3 h-full"> | ||
{face === '1' ? ( | ||
<Image src={smile} alt="smile" width={100} height={100} /> | ||
) : ( | ||
<Image src={sad} alt="sad" width={100} height={100} /> | ||
)} | ||
</div> | ||
|
||
{/* Right side: Text fields */} | ||
<div className="w-2/3 h-full pl-4 flex flex-col justify-center"> | ||
<p className="text-black">Waga: {waga} g</p> | ||
<p className="text-black">Godzina: {godzina}</p> | ||
console.log(`data:image/png;base64,${image.buffer}`); | ||
console.log(face); | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Card; | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const convertISOToDate = (isoString: string): string => { | ||
const date = new Date(isoString); | ||
|
||
const year = date.getFullYear(); | ||
const month = String(date.getMonth() + 1).padStart(2, '0'); | ||
const day = String(date.getDate()).padStart(2, '0'); | ||
|
||
//const seconds = String(date.getSeconds()).padStart(2, '0'); | ||
|
||
return `${day}-${month}-${year}`; | ||
}; | ||
|
||
export const convertISOToTime = (isoString: string): string => { | ||
const date = new Date(isoString); | ||
|
||
|
||
const hours = String(date.getHours()).padStart(2, '0'); | ||
const minutes = String(date.getMinutes()).padStart(2, '0'); | ||
//const seconds = String(date.getSeconds()).padStart(2, '0'); | ||
|
||
return `${hours}:${minutes}`; | ||
}; |