Skip to content

Commit 9021f36

Browse files
committed
Update README and improve Home.razor UI and documentation
- Added installation instructions for `CountryData.Standard` in README.md. - Replaced country info table with a dropdown menu in Home.razor. - Added XML documentation comments to `GrtCountryFlag` method.
1 parent 9d4fba1 commit 9021f36

3 files changed

Lines changed: 15 additions & 28 deletions

File tree

Assets/BlazorSample.gif

-95.2 MB
Binary file not shown.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
- 🗺️ Get country region by ISO 3166 country code
2121
- ☎️ Get country phone code by ISO 3166 country code
2222

23-
![Blazor Sample](./Assets/BlazorSample.gif)
2423

2524
### Install Library
2625
##### Package Manager

sample/CountryData.Sample.Blazor/Components/Pages/Home.razor

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,15 @@
1414
}
1515
else
1616
{
17-
<table class="table">
18-
<thead>
19-
<tr>
20-
<th>Name</th>
21-
<th>Flag</th>
22-
<th>Country Short Code</th>
23-
<th>Phone Code</th>
24-
</tr>
25-
</thead>
26-
<tbody>
27-
@foreach (var country in countries)
28-
{
29-
<tr>
30-
<td>@country.CountryName</td>
31-
<td>@GrtCountryFlag(country.CountryShortCode)</td>
32-
<td>@country.CountryShortCode</td>
33-
<td>@country.PhoneCode</td>
34-
</tr>
35-
}
36-
</tbody>
37-
</table>
17+
<label for="countryDropdown">Select a country:</label>
18+
<select id="countryDropdown" class="form-select">
19+
@foreach (var country in countries)
20+
{
21+
<option value="@country.CountryShortCode">
22+
@GrtCountryFlag(country.CountryShortCode) @country.CountryName (@country.PhoneCode)
23+
</option>
24+
}
25+
</select>
3826
}
3927

4028
@code {
@@ -51,13 +39,13 @@ else
5139
countries = await CountryService.GetCountries();
5240
}
5341

54-
55-
56-
// getting counry flag
57-
58-
public string GrtCountryFlag(string countryShortCode)
42+
/// <summary>
43+
/// Gets the country flag based on the country short code.
44+
/// </summary>
45+
/// <param name="countryShortCode">The short code of the country.</param>
46+
/// <returns>The flag of the country.</returns>
47+
public string GrtCountryFlag(string countryShortCode)
5948
{
6049
return CountryService.GetCountryFlag(countryShortCode);
6150
}
62-
6351
}

0 commit comments

Comments
 (0)