Skip to content

Commit 4236c89

Browse files
Merge pull request #11 from PseudoDevs/main
Fix for RTL Bug Issue: #8
2 parents bfe4953 + 2da5b28 commit 4236c89

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
@php
22
$isDisabled = $isDisabled();
33
$state = $getState();
4+
$isRTL = config('filament-rating-star.isRTL');
5+
$direction = $isRTL ? 'rtl' : 'ltr';
46
@endphp
57

6-
<div class="flex justify-center p-10">
7-
@for ( $i=1; $i <= count(config('filament-rating-star.stars')); $i++ )
8-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="25" height="25">
9-
<path d="M15.765,2.434l2.875,8.512l8.983,0.104c0.773,0.009,1.093,0.994,0.473,1.455l-7.207,5.364l2.677,8.576 c0.23,0.738-0.607,1.346-1.238,0.899L15,22.147l-7.329,5.196c-0.63,0.447-1.468-0.162-1.238-0.899l2.677-8.576l-7.207-5.364 c-0.62-0.461-0.3-1.446,0.473-1.455l8.983-0.104l2.875-8.512C14.482,1.701,15.518,1.701,15.765,2.434z"
10-
fill="{{ ( $state >= $i ) ? '#ffc107' : '#ddd' }}" />
11-
</svg>
12-
@endfor
13-
</div>
8+
<div class="flex justify-center p-10" dir="{{ $direction }}">
9+
@for ($i = 1; $i <= count(config('filament-rating-star.stars')); $i++)
10+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="25" height="25">
11+
<path d="M15.765,2.434l2.875,8.512l8.983,0.104c0.773,0.009,1.093,0.994,0.473,1.455l-7.207,5.364l2.677,8.576 c0.23,0.738-0.607,1.346-1.238,0.899L15,22.147l-7.329,5.196c-0.63,0.447-1.468-0.162-1.238-0.899l2.677-8.576l-7.207-5.364 c-0.62-0.461-0.3-1.446,0.473-1.455l8.983-0.104l2.875-8.512C14.482,1.701,15.518,1.701,15.765,2.434z"
12+
fill="{{ ($state >= $i) ? '#ffc107' : '#ddd' }}"/>
13+
</svg>
14+
@endfor
15+
</div>

0 commit comments

Comments
 (0)