-
Notifications
You must be signed in to change notification settings - Fork 0
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 #257 from caxewsh/mvp-ranking-system
feat: add ranking system @coderabbitai
- Loading branch information
Showing
7 changed files
with
61 additions
and
26 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,18 +1,32 @@ | ||
import React from "react"; | ||
import { View, Text } from "react-native"; | ||
import { View, Text, ScrollView } from "react-native"; | ||
|
||
const EndscreenCard = ({ players }) => { | ||
const sortedPlayers = [...players].sort((a, b) => b.score - a.score); | ||
|
||
const EndscreenCard = () => { | ||
return ( | ||
<View | ||
style={{ backgroundColor: "rgba(255, 255, 255, 0.1)" }} | ||
className="flex-1 justify-center w-78 m-10 mx-4 p-10 rounded-lg" | ||
> | ||
<Text className=" text-white font-semibold text-center text-sm"> | ||
Merci d'avoir participé à la beta. Faites nous part de vos retour | ||
via le lien ci-dessous : | ||
</Text> | ||
</View> | ||
style={{ backgroundColor: "rgba(255, 255, 255, 0.1)" }} | ||
className="flex-1 justify-center w-78 m-10 mx-4 p-10 rounded-lg" | ||
> | ||
<Text className="text-white font-semibold text-center text-sm mb-4"> | ||
Plus tu prends chères, plus tu accumules les points ! Voici les scores : | ||
</Text> | ||
|
||
<ScrollView className="mt-4"> | ||
{sortedPlayers.map((player, index) => ( | ||
<View key={index} className="flex-row justify-between my-2 p-2 bg-gray-800 rounded-lg"> | ||
<Text className="text-white font-semibold"> | ||
{player.name} | ||
</Text> | ||
<Text className="text-white font-semibold"> | ||
Score: {player.score} | ||
</Text> | ||
</View> | ||
))} | ||
</ScrollView> | ||
</View> | ||
); | ||
}; | ||
|
||
export default EndscreenCard; | ||
export default EndscreenCard; |
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
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