Skip to content

Commit

Permalink
Update README and improve Home.razor UI and documentation
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Clifftech123 committed Oct 10, 2024
1 parent 9d4fba1 commit 9021f36
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
Binary file removed Assets/BlazorSample.gif
Binary file not shown.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
- 🗺️ Get country region by ISO 3166 country code
- ☎️ Get country phone code by ISO 3166 country code

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

### Install Library
##### Package Manager
Expand Down
42 changes: 15 additions & 27 deletions sample/CountryData.Sample.Blazor/Components/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,15 @@
}
else
{
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Flag</th>
<th>Country Short Code</th>
<th>Phone Code</th>
</tr>
</thead>
<tbody>
@foreach (var country in countries)
{
<tr>
<td>@country.CountryName</td>
<td>@GrtCountryFlag(country.CountryShortCode)</td>
<td>@country.CountryShortCode</td>
<td>@country.PhoneCode</td>
</tr>
}
</tbody>
</table>
<label for="countryDropdown">Select a country:</label>
<select id="countryDropdown" class="form-select">
@foreach (var country in countries)
{
<option value="@country.CountryShortCode">
@GrtCountryFlag(country.CountryShortCode) @country.CountryName (@country.PhoneCode)
</option>
}
</select>
}

@code {
Expand All @@ -51,13 +39,13 @@ else
countries = await CountryService.GetCountries();
}



// getting counry flag
public string GrtCountryFlag(string countryShortCode)
/// <summary>
/// Gets the country flag based on the country short code.
/// </summary>
/// <param name="countryShortCode">The short code of the country.</param>
/// <returns>The flag of the country.</returns>
public string GrtCountryFlag(string countryShortCode)
{
return CountryService.GetCountryFlag(countryShortCode);
}

}

0 comments on commit 9021f36

Please sign in to comment.