Skip to content

Commit

Permalink
Merge pull request #109 from SaRTHaK0909k/hacktober_pr1
Browse files Browse the repository at this point in the history
added average temperature feature
  • Loading branch information
HridoyHazard authored Oct 4, 2023
2 parents c07635c + 45b268a commit f02faba
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/MoreInfoCard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';

function MoreInfoCard({ data }) {

const { formattedData, degreeSymbol, main, clouds, t } = data;

const averageTemp = (formattedData.temp_min + formattedData.temp_max) / 2;

return (
<div className='more-info'>
<p className=''>
Expand Down Expand Up @@ -33,8 +34,15 @@ function MoreInfoCard({ data }) {
{degreeSymbol}
</span>
</p>
<p className=''>
{t('avg-temp')}:{' '}
<span>
{averageTemp}
{degreeSymbol}
</span>
</p>
</div>
)
);
}

export default MoreInfoCard;
export default MoreInfoCard;

0 comments on commit f02faba

Please sign in to comment.